Re: nounset option: Error message points to the wrong variable when accessing associative arrays

2023-05-11 Thread Emanuele Torre
On Thu, May 11, 2023 at 10:54:36AM +, Baumann, Moritz wrote: > Sorry for bothering you again, but I might have misremembered: I looked > through the manual again and could not find any mention of this behavior > in any of the following sections: > > * Arrays > * Bash Conditional Expressions

RE: nounset option: Error message points to the wrong variable when accessing associative arrays

2023-05-11 Thread Baumann, Moritz
> > ⚠️ STOP USING [[ -v "assoc[$key]" ]]! DO NOT USE IT! ⚠️ > > > > [...] > > > > Use [[ -v 'assoc[$key]' ]] instead, so that -v can expand the variable > > correctly by itself: > > Thank you for the warning, I somehow forgot about this behavior even > though the manual mentions it explicitly.