array[0]=$((array[1]-array[2])) echo A ${array[0]}
array[3]=$((${array[4]}-${array[5]})) echo B ${array[3]}
Produces: address@hidden # ./xxx
A -5 ./xxx: line 12: array[4]: unbound variable
Can I conclude that because there is no ${} wrapper around the variables inside the arithmetic context in the first $(()) line that there is no parameter expansion going on and therefore the set -u does nothing?
Is the output intended behavior or should set -u flag the line that works as an error?
How does one get some form of protection during development if set -u doesn't work for the case I showed?