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

(P) param expansion with assoc-arrays



Given:

typeset -A hash
hash=( a 1 b 2 c 3 )

blah="hash"

Doing:
echo ${${(P)blah}[b]}

Outputs:
1

But I'm expecting it to say '2'.  It seems to me that once ${(P)blah}
is expanded, the fact that the final expansion is an associative array
has been lost.

How can I get that expression to return '2'?

-- 
Shawn Halpenny



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