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

Assign to parameter in parameter -- opposite of ${(P)name}?



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