On Thu, Jul 19, 2018 at 2:44 PM konsolebox <konsole...@gmail.com> wrote: > On Wed, Jul 18, 2018 at 5:19 AM, Grisha Levit <grishale...@gmail.com> wrote: > > $ set -u; unset var; f() { test -v 'var[0]'; echo $?; }; var[0]=X f > > 0 > > -bash: var[0]: unbound variable > > I'm not getting this error. What version of bash are you using?
Sorry about that, the command should have been: set-u; f() { test -v var[0]; echo $?; echo ${var[0]}; }; var[0]=X f