zsh-users
 help / color / mirror / code / Atom feed
* Assign to parameter in parameter -- opposite of ${(P)name}?
@ 2010-07-09 23:17 Benjamin R. Haskell
  2010-07-10  1:13 ` Frank Terbeck
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Benjamin R. Haskell @ 2010-07-09 23:17 UTC (permalink / raw)
  To: Zsh Users

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-07-10 17:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-09 23:17 Assign to parameter in parameter -- opposite of ${(P)name}? Benjamin R. Haskell
2010-07-10  1:13 ` Frank Terbeck
2010-07-10 15:36   ` Benjamin R. Haskell
2010-07-10 15:44     ` Frank Terbeck
2010-07-10 15:54       ` Benjamin R. Haskell
2010-07-10 14:57 ` Julius Plenz
2010-07-10 15:52   ` Benjamin R. Haskell
2010-07-10 17:39 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).