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

Re: sh compatibility RE: PATCH: pws-19: document minor syntactic innovation



"Andrej Borsenkow" wrote:
> > This is the patch below; ${"foo"%bar} will now work.
> 
> How compatible with shell is it?
> 
> bor@itsrm2:~%> /sbin/xpg4/sh (for what it's worth :-)
> $ foo=bar
> $ print ${"foo"}
> /sbin/xpg4/sh: ${"foo"}: bad substitution
> $ print ${"bar":-com}
> /sbin/xpg4/sh: ${"bar":-com}: bad substitution

Personally, I'm not too worried about things which give `bad substitution'
in other shells --- note that the presence of quotes never gave you that
message in zsh before, it simply didn't do anything.  We've already got a
whole heap of cases which zsh accepts but other shells don't.  If we embark
on a syntax-tightening exercise, I rather suspect we'll never get to the
end.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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