bug-bash
[Top][All Lists]
Advanced

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

Re: Changing the way bash expands associative array subscripts


From: Chet Ramey
Subject: Re: Changing the way bash expands associative array subscripts
Date: Mon, 5 Apr 2021 09:44:50 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.0

On 4/1/21 3:02 PM, konsolebox wrote:

To do what, exactly?

To keep this working in both behaviors.

declare -A a
key='$(echo foo)'
a[$key]=1
unset 'a["$key"]'
declare -p a # declare -A a=()

I suppose. You'll be able to set compatibility levels to make this work
without resorting to wrappers.

--
``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/



reply via email to

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