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

Surprising parsing result with anonymous functions and for loops



The intended command was something along these lines:
() { for a { echo $a } } some words here
but I forgot the enclosing { } and wrote the following
() for a { echo $a } some words here
surely this doesn't work, right?... wrong:
% () for a { echo $a } some words here
some
words
here

Perhaps even more surprising is the following:
% () for a { echo $a } ls
ls
--color=auto
-T
0
-A
-v
--quoting-style=shell

I haven't looked at the parsing for the anonymous function stuff, but
if it's not too hairy to fix, my vote is we drop this easter egg at
some point.

-- 
Mikael Magnusson



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