Re: Behaviour of test -v with assoc array and quote character in key
From:
Oğuz
Subject:
Re: Behaviour of test -v with assoc array and quote character in key
Date:
Tue, 23 Feb 2021 17:38:55 +0200
23 Şubat 2021 Salı tarihinde Greg Wooledge <wooledg@eeg.ccf.org> yazdı:
> On Tue, Feb 23, 2021 at 02:03:55PM +0100, Andreas Schwab wrote:
> > On Feb 23 2021, Greg Wooledge wrote:
> >
> > > No amount of quoting will make (( 'assoc[$var]'++ )) work.
> >
> > (( assoc[var]++ ))
> >
> > Andreas.
>
> This is not the same as assoc[$var]. Yours uses the literal string var
> as the key, not the contents of the variable named var.
`(( assoc[\$var]++ ))' works fine as usual.
--
Oğuz