zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: dominik.vogt@gmx.de, Zsh Users <zsh-users@zsh.org>
Subject: Re: -u option does not work with recursive expansion?
Date: Fri, 15 Feb 2019 00:45:28 +0100	[thread overview]
Message-ID: <CAHYJk3QLzi=H7ZoM4mObfr1drKHpgfNA_KPPsP6oBQaGSqpoCg@mail.gmail.com> (raw)
In-Reply-To: <20190214230743.drgd47wuwapj5os3@gmx.de>

On 2/15/19, Dominik Vogt <dominik.vogt@gmx.de> 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

  reply	other threads:[~2019-02-14 23:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 23:07 Dominik Vogt
2019-02-14 23:45 ` Mikael Magnusson [this message]
2019-02-15  0:41   ` Dominik Vogt
2019-02-15  1:10     ` Bart Schaefer
2019-02-15  1:41     ` Matthew Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3QLzi=H7ZoM4mObfr1drKHpgfNA_KPPsP6oBQaGSqpoCg@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=dominik.vogt@gmx.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).