Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14369

Re: test -v and environment variable names with subscripts

From Grisha Levit <grishalevit@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: test -v and environment variable names with subscripts
Date 2018-07-19 15:26 -0400
Message-ID <mailman.3841.1532028429.1292.bug-bash@gnu.org> (permalink)
References <CAMu=BrooFcyHWsERqYnbcgHertcGs2VG6Acb+sK4cWxT8cNCDg@mail.gmail.com> <CAJnmqwZQSAqdmVUT7fnsoMaWsb1=6kvw7TXfEs5V3d4ZrGgiVw@mail.gmail.com>

Show all headers | View raw


On Thu, Jul 19, 2018 at 2:44 PM konsolebox <konsolebox@gmail.com> wrote:
> On Wed, Jul 18, 2018 at 5:19 AM, Grisha Levit <grishalevit@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

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: test -v and environment variable names with subscripts Grisha Levit <grishalevit@gmail.com> - 2018-07-19 15:26 -0400

csiph-web