Nevermind.
I was pointed at
http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00120.html which
explains the issue.
On 30/01/15 12:13, Øyvind 'bolt' Hvidsten wrote:
Tested with shbot in #bash (freenode):
42# set -u; declare -a foo; echo ${#foo[@]}
0
43# set -u; declare -a foo; echo ${#foo[
Tested with shbot in #bash (freenode):
42# set -u; declare -a foo; echo ${#foo[@]}
0
43# set -u; declare -a foo; echo ${#foo[@]}
bash: foo: unbound variable
43# set -u; foo=(); echo ${#foo[@]}
0
Is this a bug?