Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15034

Re: Unset builtin not respecting single quotes / doing its own dereferencing

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: Unset builtin not respecting single quotes / doing its own dereferencing
Date 2019-01-02 09:27 -0500
Message-ID <mailman.6695.1546439244.1284.bug-bash@gnu.org> (permalink)
References <1209666090.70217.1546426530675@office.mailbox.org>

Show all headers | View raw


On 1/2/19 5:55 AM, bitbucket@mailbox.org wrote:

>    Bash Version: 4.4
>    Patch Level: 19
>    Release Status: release

>    Description:
>    When unsetting elements of an associative array, unset does not respect
>    the quoting rules, and does its own dereferencing. The behaviour
>    appears to be incorrect, or at least undocumented.

Yes. Associative array subscript expansion is consistent whether or not the
word has undergone shell expansion. This has been discussed many times in
the past.

There is a shell option in bash-5.0, `assoc_expand_once', that implements
the behavior you want.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Unset builtin not respecting single quotes / doing its own dereferencing Chet Ramey <chet.ramey@case.edu> - 2019-01-02 09:27 -0500

csiph-web