Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
(P) param expansion with assoc-arrays
- X-seq: zsh-users 8630
- From: Shawn Halpenny <paxunix@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: (P) param expansion with assoc-arrays
- Date: Wed, 23 Mar 2005 09:39:03 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=Rj/8bhbOXTts6jxlomGK3crUk81z18o2Jiolg3/rN2Wbsvmn8GeZhrMKgGbEIuGXRAxIXoSTaxKesK97Hh0+AcKe5KZhWqGk9MpLuxlsjDA3g7y1kmWTgUvmNYXGhC5B5n5cPfPX/zoVtXzEtuAdzyj894MUN+t8ZfNq3Nj7MQ0=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Reply-to: Shawn Halpenny <paxunix@xxxxxxxxx>
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