bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Change in indirect expansion behavior from 4.4 to 5.0


From: Davide Brini
Subject: Re: Change in indirect expansion behavior from 4.4 to 5.0
Date: Wed, 30 Sep 2020 11:06:43 +0200

On Tue, 29 Sep 2020 21:28:59 -0700, Jason Miller <jasom@fastmail.com> wrote:

> Gentoo linux, GNU bash, version 5.0.18(1)-release (x86_64-pc-linux-gnu)
>
> On the above vesion of bash, the following script will not run the echo
> command and print an error.  On bash 4.4 it appears to  treat the ${!foo}
> the same as expanding an unset variable and thus outputs "bar":
>
>   unset foo
>   echo ${!foo} bar
>
> "shopt -s compat44" does not seem to make a difference

This is documented, and thus (I suppose) on purpose. See the file CHANGES:

This document details the changes between this version, bash-5.0-alpha, and
the previous version, bash-4.4-release.

...

y. If indirect expansion attempts to indirectly reference through an unset
   variable, report an error.

--
D.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]