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

Re: [BUG] (z)-flag interrupts if $() in input



On Oct 30,  3:25pm, Daniel Shahaf wrote:
}
} "eval $a" returns a parse error in zsh but succeeds in sh.  Let's put
} (z) to one side for the moment;

This actually is a question about (z) rather than about parse errors,
because other parse errors don't have the same problem:

torch% echo ||| print
zsh: parse error near `|'
torch% a='echo ||| print'
torch% print -rl -- ${(z)a}
echo
||
|
print

So the question is not whether $() is a parse error, but why $() eats
the rest of the command line.

Which I think is going to come down to the way cmd_or_math() has to
read ahead to discover whether $( starts a math expresion or a
command substitution -- but I haven't dug in that far.



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