2021年3月12日(金) 4:37 Alex fxmbsw7 Ratchev <fxmb...@gmail.com>:
> maybe implent a shopt -s no_expand_subshells

There is already `shopt -s assoc_expand_once'. With this shell option,
one can write `unset "blah[$i]"'.

But such an option actually doesn't completely solve all similar cases
including the associative array access in arithmetic contexts. Instead
one can always write as

$ unset 'blah[$i]'
$ ((blah[\$i]))
$ etc.

Also, there was a thread on exactly the same topic last week:
https://lists.gnu.org/archive/html/bug-bash/2021-03/msg00004.html
https://lists.gnu.org/archive/html/bug-bash/2021-03/msg00005.html
https://lists.gnu.org/archive/html/bug-bash/2021-03/msg00008.html

--
Koichi

Reply via email to