Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

function with SH_GLOB



Hello:

I'm reading the manual(6.3) ,about function. That says:

> If the option SH_GLOB is set for compatibility with other shells, then whitespace may appear between the left and right parentheses when there is a single word; otherwise, the parentheses will be treated as forming a globbing pattern in that case.

I made my tests below:

test % zsh -f
bsd% unsetopt shglob
bsd% func1()
function> {print ok}
bsd% func2 ()
function> {print ok}
bsd% func3( )
zsh: unknown file attribute:
bsd% func4 ( )
zsh: unknown file attribute:
bsd% setopt shglob
bsd% func5()
function> {print ok}
bsd% func6 ()
function> {print ok}
bsd% func7( )
zsh: parse error near `('
bsd% func8 ( )
zsh: parse error near `('

I'm confused. When  'setopt shglob',definitions should be OK?

Now, I only know "Do not put space between ()"




Messages sorted by: Reverse Date, Date, Thread, Author