bug-bash
[Top][All Lists]
Advanced

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

Re: "set -u" and empty arrays


From: Greg Wooledge
Subject: Re: "set -u" and empty arrays
Date: Thu, 9 May 2019 08:29:14 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Thu, May 09, 2019 at 01:07:16PM +0200, Ulrich Windl wrote:
> Bash Version: 4.3
> Patch Level: 48
> Release Status: release
> 
> Hi!
> 
> Is this intended with "set -u":
> # set -u
> # declare -a INSTANCES
> # echo ${INSTANCES[*]}
> bash: INSTANCES[*]: unbound variable
> # INSTANCES=()
> # echo ${INSTANCES[*]}
> bash: INSTANCES[*]: unbound variable
> # echo ${INSTANCES[@]}
> bash: INSTANCES[@]: unbound variable

wooledg:~$ echo "$BASH_VERSION"
5.0.3(1)-release
wooledg:~$ set -u
wooledg:~$ declare -a a
wooledg:~$ echo "${a[*]}"

wooledg:~$ echo "${a[@]}"


Looks like the behavior has already been changed.  Your version of bash
is two major releases behind.



reply via email to

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