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

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



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