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

Re: ${$^foo} weirdness



Andrej Borsenkow wrote:

> I stumbled on it when testing some other thing ...
> 
> bor@itsrm2:/tools/src/zsh-3.1.5-pws-13%> foo=(a b)
> bor@itsrm2:/tools/src/zsh-3.1.5-pws-13%> bar=(x y)
> bor@itsrm2:/tools/src/zsh-3.1.5-pws-13%> print ${$^foo}{1,2}$bar 
> 195811x 195812x y
> bor@itsrm2:/tools/src/zsh-3.1.5-pws-13%> print ${${^foo}}{1,2}$bar
> a b1x b2x y

What you don't think of is that `$$' gives the PID and what you don't
know is that for special parameter names such as `$' the rest is
ignored.
But the manual explicitly says that nested substitution works only for 
`${...}' or `$(...)'.

With that the above is correct -- for certain values of `correct'.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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