[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: nounset option: Error message points to the wrong variable when acce
From: |
Baumann, Moritz |
Subject: |
RE: nounset option: Error message points to the wrong variable when accessing associative arrays |
Date: |
Thu, 11 May 2023 10:54:36 +0000 |
> > ⚠️ 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.
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
* Conditional Constructs
Maybe I'm blind, but is it possible that the manual never mentions or
implies that -v expands variables by itself?
- nounset option: Error message points to the wrong variable when accessing associative arrays, Baumann, Moritz, 2023/05/10
- Re: nounset option: Error message points to the wrong variable when accessing associative arrays, Emanuele Torre, 2023/05/10
- Re: nounset option: Error message points to the wrong variable when accessing associative arrays, Emanuele Torre, 2023/05/10
- RE: nounset option: Error message points to the wrong variable when accessing associative arrays, Baumann, Moritz, 2023/05/10
- Re: nounset option: Error message points to the wrong variable when accessing associative arrays, Emanuele Torre, 2023/05/10
- RE: nounset option: Error message points to the wrong variable when accessing associative arrays, Baumann, Moritz, 2023/05/10
- RE: nounset option: Error message points to the wrong variable when accessing associative arrays,
Baumann, Moritz <=
- Re: nounset option: Error message points to the wrong variable when accessing associative arrays, Emanuele Torre, 2023/05/11
- Re: nounset option: Error message points to the wrong variable when accessing associative arrays, alex xmb ratchev, 2023/05/10
Re: nounset option: Error message points to the wrong variable when accessing associative arrays, Andreas Schwab, 2023/05/10