unbound variable error with set -u on empty array expansion
Goal Determine the intended behavior for empty arrays under set -u when using default-value expansions, and identify a reliable pattern that preserves nounset safety without boilerplate. Constraints and uncertainty Bash 4.4 and later treat a zero-element array as unset for nounset purposes, so ${arr[@]} triggers unbound variable even when the array variable