From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3902 invoked from network); 22 Jan 2002 00:04:11 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 22 Jan 2002 00:04:11 -0000 Received: (qmail 2645 invoked by alias); 22 Jan 2002 00:04:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16479 Received: (qmail 2631 invoked from network); 22 Jan 2002 00:04:01 -0000 To: raul@viadomus.com, schaefer@brasslantern.com Subject: Re: Bad expansion Cc: zsh-workers@sunsite.dk Message-Id: Date: Tue, 22 Jan 2002 01:17:03 +0100 From: DervishD Reply-To: DervishD Sender: DervishD X-Mailer: DervishD TWiSTiNG Mailer Hello Bart :) >> >> # Bad substitution >> >> echo ${${testing[1]}_VALUE} >> >echo ${(e):-\$${testing[1]}_VALUE} >> >The :-\ is a smiley that means "maybe there ought to be a neater way". >> Are you joking? >Yes, he is. I knew, just a rethoric question ;)))) >> "Expand identifier, and, if it is not defined or missing >> (which is true), expand the other thing, that is, \$${testing[1]}_VALUE" >Almost. You forgot about the (e). The whole expression means: Oh, I see O:)) The expansions... I was misguided by the smiley XDD >> Seriously: why am I having the 'bad substitution' error? What am >> I doing wrong?. This interest me more than the solution. >Anything that looks like ${${...}} is called a "nested substitution". The >stuff inside the outermost ${...} can take one of two forms: >(1) it can be the name of a parameter (in which case the substitution is > not nested, of course), plus an optional [...] subscript; >(2) it can be another ${...} substitution expression plus an optional > subscript. Crystal clear now. I didn't understand the rules for nested substitution on the zsh manual. Thanks a lot :) You are of invaluable help, truly. It's people like Zefram and you that makes me proud of using Linux, Zsh and all that good free software out there. You're great. Raśl