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 15155
- From: Julius Plenz <julius@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Assign to parameter in parameter -- opposite of ${(P)name}?
- Date: Sat, 10 Jul 2010 16:57:28 +0200
- In-reply-to: <alpine.LNX.2.01.1007091908420.4808@xxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mail-followup-to: zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <alpine.LNX.2.01.1007091908420.4808@xxxxxxxxxxx>
Hi, Benjamin!
* Benjamin R. Haskell <zsh@xxxxxxxxxx> [2010-07-10 01:35]:
> but how do you *assign* to a parameter whose name is in a parameter?
> name=foo
> : ${${(P)name}::=something}
> echo $foo
> # should echo 'something'
How about:
zsh> name=foo
zsh> typeset $name=something
zsh> echo $foo
something
Julius
Messages sorted by:
Reverse Date,
Date,
Thread,
Author