From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 811 invoked from network); 23 Jan 2004 22:49:58 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 23 Jan 2004 22:49:58 -0000 Received: (qmail 25146 invoked by alias); 23 Jan 2004 22:49:06 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7012 Received: (qmail 21932 invoked from network); 23 Jan 2004 22:42:24 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 23 Jan 2004 22:42:24 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [129.170.17.94] by sunsite.dk (MessageWall 1.0.8) with SMTP; 23 Jan 2004 22:42:23 -0000 Received: from descolada.dartmouth.edu (descolada.dartmouth.edu [129.170.19.25]) by mailhub4.dartmouth.edu (8.12.10+DND/8.12.10) with ESMTP id i0NMgKCW023236 for ; Fri, 23 Jan 2004 17:42:20 -0500 Received: from omen by descolada.dartmouth.edu with local (Exim 3.36 #1 (Debian)) id 1AkA0K-0007DW-00 for ; Fri, 23 Jan 2004 17:42:20 -0500 Date: Fri, 23 Jan 2004 17:42:20 -0500 From: Omen Wild To: zsh users Subject: Build a variable name from another variable? Message-ID: <20040123224220.GB3354@descolada.dartmouth.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline User-Agent: Mutt/1.5.4-2i X-MailScanner: No virus detected by mailhub4.Dartmouth.EDU --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I am not totally sure what it is called, but I want to build a variable name dynamically, from the contents of another variable. That is, I have: ----- Begin script ----- barcontents=3D"bar contents" baz=3D"bar" echo $barcontents # <---- effect I want echo ${${baz}contents} # <---- how I want to get there ----- End script ----- I get this error: bad substitution I think the answer involves the (P) flag, as in: echo ${${(P)baz}contents} But that dies with the same error. I am running Debian unstable, zsh version 4.0.9. Thanks, Omen --=20 I used up all my sick days, so I'm calling in dead. --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAEaNM6QDOrpNC/+sRAs7vAJ9+DO92byHbV6bzfCYLFui+W5nkJgCgiwr0 R5JkOTRHcxuNN0fOK6jVtsk= =WQY6 -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs--