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

expansion of nested parameters



Hiya, quick question:

Not on list these days, please CC me in on replies - thanks.

This is with zsh-3.0.7:
-----------------------------< cut here >-------------------------------
#!/bin/zsh -f
a=foo
wib_foo_ble=Wow
c=\$wib_${a}_ble
print ${(e)c}
print ${(e)\$wib_${a}_ble}
-----------------------------< cut here >-------------------------------

1: Why does the second print statement print out the current process ID
   from $$ instead of printing the same as the first print statement?

2: Is there a way to do this without using an intermediate variable, as
   I've done with $c and without using eval statements?

For now, since the job needs doing, I'm using an intermediate, but the
perfectionist in me wants to know what I was doing wrong?

Or is the answer really obvious, and it's my fault for not using zsh so
heavily these days?  :^)

Thanks folks,
-- 
--> Phil Pennock (!PP8185)



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