Re: wrong variable name in error message about unbound variable?
From:
alex xmb sw ratchev
Subject:
Re: wrong variable name in error message about unbound variable?
Date:
Tue, 17 Oct 2023 15:16:05 +0200
On Tue, Oct 17, 2023, 15:09 Zachary Santer <zsanter@gmail.com> wrote:
> On Tue, Oct 17, 2023 at 8:43 AM Zachary Santer <zsanter@gmail.com> wrote:
>
> > On Tue, Oct 17, 2023 at 8:00 AM Greg Wooledge <greg@wooledge.org> wrote:
> >
> >> unicorn:~$ unset -v a b c array
> >> unicorn:~$ a=b b=c c=42 array[a]=foo; declare -p array
> >> declare -a array=([42]="foo")
> >>
> > What? What is Bash doing here? Dereferencing iteratively until it finds
> > something it can do arithmetic with?
> >
>
> $ unset -v a b c d array
> $ a=b b=c c=d array[a]=foo; declare -p array
> -bash: d: unbound variable
>
declare -A array
and
array[$a]=foo
I guess so. That seems like a ... strange thing to implement.
>