On Thu, Dec 16, 2021, at 11:45 PM, Lawrence Velázquez wrote:
> Did you mean to say that ${#FOO[*]} causes an error?  Because
> ${FOO[*]} does not, à la $*:
>
> [...]
>
> Like ${FOO[*]}, ${FOO[@]} and $@ are exempt from ''set -u''.

Perhaps you're using an old bash, like the one shipped with macOS?

    % /bin/bash --version | head -n 1
    GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)
    % /bin/bash -uc ': "${FOO[*]}"'
    /bin/bash: FOO[*]: unbound variable
    % /bin/bash -uc ': "${FOO[@]}"'
    /bin/bash: FOO[@]: unbound variable

If so, there's not much anyone here can do about it.

-- 
vq

Reply via email to