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

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



> 
> This is the patch below; ${"foo"%bar} will now work.  There are still
> probably lots of other possible places, but I don't think it's worth
> searching for them; if it seems sensible to allow quotes there, someone
> will notice at some point.
> 

How compatible with shell is it?

bor@itsrm2:~%> foo=bar
bor@itsrm2:~%> print $"foo"
$foo
bor@itsrm2:~%> print ${"foo"}
bar
bor@itsrm2:~%> print ${"bar":-com}

but

bor@itsrm2:~%> /sbin/xpg4/sh (for what it's worth :-)
$ foo=bar
$ print $"foo"
$foo
$ print ${"foo"}
/sbin/xpg4/sh: ${"foo"}: bad substitution
$ print ${"bar":-com}
/sbin/xpg4/sh: ${"bar":-com}: bad substitution



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