4 ms·
The problem with "${arr[@]}" only exists on bash 3 and before, since bash 4 4.4 fixed it: $ bash --version GNU bash, version 4.3.48(1)-release (x86_64-pc-
by mmsc 3y ago
The problem with "${arr[@]}" only exists on bash 3 and before, since bash 4
4.4 fixed it:
$ bash --version
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
$ declare -A arr
$ set -u
$ "${arr[@]}"
-bash: arr[@]: unbound variable
- augusto-moura 3y agoAh, that's true, I couldn't recall which version fixed it. Usually I assume v4 because any other distro automatically updates to the latest v4 version or latest version af all. macOS is the only one out there missing on this. The other big feature that was only added after bash 3 and is missing on mac is associative arrays