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

Re: Why this doesn't work in zsh?

DervishD wrote:
>     for parameter
>     do
>     ...
>         option=${parameter%=*}
>     ...
>     done
>     It has to work with both bash and zsh, but zsh says, when the
> assignment is done, '* not found'.

You can stick a backslash before the =; that works in bash, too, since
you can quote any character, even if it's not special.

The problem is that it's using path expansion `=prog', but I couldn't
tell you why it should at that point; in fact, I suspect it shouldn't.
Hence `setopt noequals' or `setopt nonomatch' would remove the problem,
if you can live with the side effects.

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070

The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
If you received this in error, please contact the sender and 
delete the material from any computer.

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