bug-bash
[Top][All Lists]
Advanced

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

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


From: Chet Ramey
Subject: Re: Unset builtin not respecting single quotes / doing its own dereferencing
Date: Wed, 2 Jan 2019 09:27:11 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.3.3

On 1/2/19 5:55 AM, address@hidden 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    address@hidden    http://tiswww.cwru.edu/~chet/



reply via email to

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