Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: -u option does not work with recursive expansion?
- X-seq: zsh-users 23870
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: dominik.vogt@xxxxxx, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: -u option does not work with recursive expansion?
- Date: Fri, 15 Feb 2019 00:45:28 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=xgodTkimhWZbqEPRRJ/MQss8n0JlmQWL7yNV3T46/Z4=; b=GI0zzIXAVu1yv1wk1zrduainGU9u6G+vMDtw0vhp01bx92puxT3awOjVbytwSQcOQx 7rnP8SSkOpSFtiXGEmA8XTKdulVijpjGaoAV0FUEypSjKXIeuMF7GOn+OTLIPsf+qYBL Z1mjTk/9ZUnh1DyamuM6oxDMBh2a562zv6Ti291SCXmdpLQhE4KfFoIljJfJpnTr1Gvt 1mO1/93wRcMU0/Kz+rDpdDC9geHV25kTFpApq9NJ5uRBskKwHeZGRjp9I02KwZEe9Jpr CW0ARG/+sCNOuAta40tAMInaxxP+LwG/HvwQ8USERxreNfbPyha2DOF0tz5y+4cukt7e vU1A==
- In-reply-to: <20190214230743.drgd47wuwapj5os3@gmx.de>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20190214230743.drgd47wuwapj5os3@gmx.de>
On 2/15/19, Dominik Vogt <dominik.vogt@xxxxxx> 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.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author