as a side info, only interpretation of vars in builtins may be affected, eg
solution as written : single quote the '$ley', on the other side
${var[$faulty_key]} doesnt eval it, only args usage as for declare unset
and [[ -v
.. maybe ..
On Mon, Mar 1, 2021 at 3:40 PM Greg Wooledge wrote:
> felix
felix (fe...@f-hauri.ch) wrote:
> There it is:
>
> $ declare -A map; key='foo$(uname >/dev/tty)bar'; map[$key]=
> $ echo map["$key"]
> map[foo$(uname >/dev/tty)bar]
> $ echo ${map["$key"]}
>
> $ unset map["$key"]
> Linux
Yeah, it's sad but true. I've just added a whole (short) section on
assoc
2021年3月1日(月) 18:37 felix :
> $ unset map["$key"]
> Linux
This is a topic that is often discussed on this mailing list, and I
think the conclusion is that we should always write it as
$ unset 'map[$key]'
In addition to the extra expansions of the array subscripts, `unset
map["$key"]' has another