This seems to be the following change (from CHANGES)
>
a. Using ${a[@]} or ${a[*]} with an array without any assigned elements when
the nounset option is enabled no longer throws an unbound variable error.
This mirrors the behavior of $@.
On Jan 26, 2017 4:28 PM, "L A Walsh" <[email protected]> wrote:
If I set bash to complain about uninitialized variables
w/-u, I get inconsistent, and seemingly incorrect behavior:
echo $BASH_VERSION
>
4.4.5(1)-release
> set -u
> echo ${undefvar}
>
bash: undefvar: unbound variable
> echo ${undefvar[@]}
>
# no message about unbound var
> echo ${undefvar}
>
bash: undefvar: unbound variable # -u is still in effect