Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: TRAPEXIT question
- X-seq: zsh-workers 7367
- From: Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>
- To: greg@xxxxxxxxxxxxxx, zsh-workers@xxxxxxxxxxxxxx (Zsh list)
- Subject: Re: TRAPEXIT question
- Date: Thu, 05 Aug 1999 10:34:06 +0200
- In-reply-to: "Greg Klanderman"'s message of "Wed, 04 Aug 1999 17:54:24 DFT." <14248.46736.675369.613655@xxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Greg Klanderman wrote:
> So is there an easy way to indirect through the value of a variable?
> I know I can use eval, but, for example, in BASH you can do
>
> foo=bar
> bar=baz
> echo ${!foo} -> baz
The zsh equivalent (from 3.1.6) is
foo=bar
bar=baz
echo ${(P)foo}
There may be some reason why didn't use !, which I think was mentioned at
some point, but I can't remember what it was.
--
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
Messages sorted by:
Reverse Date,
Date,
Thread,
Author