Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Assign to parameter in parameter -- opposite of ${(P)name}?
- X-seq: zsh-users 15156
- From: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- To: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: Assign to parameter in parameter -- opposite of ${(P)name}?
- Date: Sat, 10 Jul 2010 11:36:05 -0400 (EDT)
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <87fwzst9ys.fsf@xxxxxxxxxxxxxxxxxxxxxx>
- 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
- References: <alpine.LNX.2.01.1007091908420.4808@xxxxxxxxxxx> <87fwzst9ys.fsf@xxxxxxxxxxxxxxxxxxxxxx>
On Sat, 10 Jul 2010, Frank Terbeck wrote:
> Benjamin R. Haskell wrote:
> > 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?
> [...]
> > Do I need to resort to 'eval'?
>
> % typeset foobar=baz
> % print ${foobar}
> baz
>
I was tired... but not thaaat tired... :-)
Using different variable names, I was looking for:
name=xyzzy
value=asdf
# <-- something that doesn't involve the string xyzzy
echo $xyzzy # echoes 'asdf'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author