Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Assign to parameter in parameter -- opposite of ${(P)name}?
- X-seq: zsh-users 15153
- From: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Assign to parameter in parameter -- opposite of ${(P)name}?
- Date: Fri, 9 Jul 2010 19:17:38 -0400 (EDT)
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
It's the end of the week, and I'm tired, so I'm sure I'm completely
overlooking something obvious, but how do you *assign* to a parameter
whose name is in a parameter?
E.g., my latest guess:
name=foo
: ${${(P)name}::=something}
echo $foo
# should echo 'something'
Instead I get:
zsh: not an identifier:
Earlier attempt:
: ${${name}::=something}
Do I need to resort to 'eval'?
--
Best,
Ben
Messages sorted by:
Reverse Date,
Date,
Thread,
Author