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

On the quoting of braces



Hi,

comparing different shells, I noticed zsh is overly careful for unquoted
braces:

ksh93$ echo {}
{}
ksh93$ echo {foo}
{foo}
ksh93$ echo {foo,bar}
foo bar
ksh93$ echo { foo,bar }
{ foo,bar }

bash4$ echo {}
{}
bash4$ echo {foo}
{foo}
bash4$ echo {foo,bar}
foo bar
bash4$ echo { foo,bar }
{ foo,bar }

zsh% echo {}
{}
zsh% echo {foo}
{foo}
zsh% echo {foo,bar}
foo bar
zsh% echo { foo,bar }
zsh: parse error near `}'

Why does this error appear?  The only way to disable it seems to be
IGNORE_BRACES, which completely disables (the much used) brace expansion.
("disable -r '}'" would break "{ cmd; cmd2 }")

Thanks,
-- 
Christian Neukirchen  <chneukirchen@xxxxxxxxx>  http://chneukirchen.org



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