bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unsetting associative array executes commands


From: Koichi Murase
Subject: Re: unsetting associative array executes commands
Date: Fri, 12 Mar 2021 04:55:51 +0800

2021年3月12日(金) 4:37 Alex fxmbsw7 Ratchev <fxmbsw7@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

[Prev in Thread] Current Thread [Next in Thread]