From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20776 invoked from network); 21 Jan 2002 14:44:23 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 21 Jan 2002 14:44:23 -0000 Received: (qmail 15861 invoked by alias); 21 Jan 2002 14:44:07 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16470 Received: (qmail 15819 invoked from network); 21 Jan 2002 14:43:52 -0000 To: Zsh Subject: Bad expansion Message-Id: Date: Mon, 21 Jan 2002 15:56:41 +0100 From: DervishD Reply-To: DervishD Sender: DervishD X-Mailer: DervishD TWiSTiNG Mailer Hello all :)) I have a doubt with parameter expansion, because I'm getting an error of 'bad substitution' on the following code # Let's assume I have the following array testing=(one two three) export testing export one_VALUE=DD # The following line correctly outputs 'one_VALUE' echo $testing[1]_VALUE # Idem echo ${testing[1]}_VALUE # Bad substitution echo ${${testing[1]}_VALUE} The problem is that I will need even further expansion, because I want to do 'echo ${(P)${testing[1]}_VALUE}', that is, I want the output of one_VALUE. And, because the rest of the script, I cannot use directly the value of one_VALUE in the array 'testing'. What am I doing wrong? Just in case, I want to do what is achieved under Bash with ${!${testing[0]}_VALUE}. Please note that arrays start at 0 under Bash, not at 1. Thanks a lot in advance Raśl