From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id ceaebe11 for ; Fri, 15 Feb 2019 00:46:44 +0000 (UTC) Received: (qmail 26343 invoked by alias); 15 Feb 2019 00:46:28 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23871 Received: (qmail 2178 invoked by uid 1010); 15 Feb 2019 00:46:28 -0000 X-Qmail-Scanner-Diagnostics: from mout.gmx.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(212.227.15.18):SA:0(-2.6/5.0):. Processed in 1.726447 secs); 15 Feb 2019 00:46:28 -0000 X-Envelope-From: dominik.vogt@gmx.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Date: Fri, 15 Feb 2019 01:41:10 +0100 From: Dominik Vogt To: Zsh Users Subject: Re: -u option does not work with recursive expansion? Message-ID: <20190215004110.wq4pluv3fprt3gtf@gmx.de> Reply-To: dominik.vogt@gmx.de Mail-Followup-To: Zsh Users References: <20190214230743.drgd47wuwapj5os3@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Provags-ID: V03:K1:fqSPimEGRk63MqISeHlnrgQbHqvBAbFFPuIxSXOvlC1T9Cudz3m pXHBP5Hwy4yLNwowObjcWJ0t4fdDhkVpYgkOpJEHOBKx0N5CuFqGu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VUqThdcYUFRP7gK6AYdoLK25VBmXRndDAbX7ZBmtT8 On Fri, Feb 15, 2019 at 12:45:28AM +0100, Mikael Magnusson wrote: > On 2/15/19, Dominik Vogt wrote: > > Why does the recursive expansion of foo not trigger an error > > message with the -u option? Is that a bug? Is there some > > woraround to get the expected error behaviour in all cases? > > > > -- snip -- > > set -u > > foo=bar > > unset bar > > # ==> bar: parameter not set > > echo $bar > > # ==> no error? > > echo ${${foo}} > > -- snip -- > > If the above command doesn't output bar, your shell is very broken. I > think you're confused about what ${${foo}} means though. Putting a ${} > inside another ${} doesn't perform indirect expansion, you need (P) > for that. Yeah, you're right. My memory believes this was different at some distant point in the past, i.e. that ${${A}} used to do recursive expansion. Well, with (P) it's possible to do recursive expansion at the right side of an assigntment, but can you also do soething like foo=bar ${foo}=baz i.e. treat the contents of foo as the lvalue of an assignment? (Without using eval, of course.) Ciao Dominik ^_^ ^_^ -- Dominik Vogt