Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16739

Re: Bash parameter transforamtion on empty array triggers unset variable.

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: Bash parameter transforamtion on empty array triggers unset variable.
Date 2020-08-11 09:51 -0400
Organization ITS, Case Western Reserve University
Message-ID <mailman.1554.1597153891.2739.bug-bash@gnu.org> (permalink)
References <CAJjXSE9b8G0aXyc+t58cbYRwFbiN5eX2rpKnyFwg728x5ZQhKQ@mail.gmail.com> <3ddb8a56-c7d0-b87e-8bb4-520acecc90d5@case.edu>

Show all headers | View raw


On 8/10/20 5:52 PM, Andrew Neff wrote:

> Bash Version: 5.1
> Patch Level: 0
> Release Status: alpha
> 
> Description:
>         I do not know if this is related to bash 5.1 erroneously being
> "a little aggressive about skipping over empty strings" mentioned
> in "Declaring arrays with empty string in one line is bugged", but using
> parameter transformation on an empty array, throws an error if "set -u" is
> turned on. This was not how bash 4.4 and 5.0 worked. This bug makes it
> impossible to check if an empty variable is an array using parameter
> transformation while "set -u" is turned on

This was a bug in bash-5.0 (and 4.4) and was fixed in early March 2019 as
the result of

https://lists.gnu.org/archive/html/bug-bash/2019-03/msg00010.html

It's in CHANGES.

There are some other changes in how bash displays attributes of unset
variables when `nounset' is not enabled, but unset variables used in word
expansions should trigger an error -- with the usual @/* exceptions -- when
set -u is enabled.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: Bash parameter transforamtion on empty array triggers unset variable. Chet Ramey <chet.ramey@case.edu> - 2020-08-11 09:51 -0400

csiph-web