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, 29 Mar 2021 10:55:46 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 3/15/21 9:03 PM, Léa Gris wrote:

zsh also provide a nice feature to iterate both keys and values in a single loop:

for key value in "${(kv)assoc_array}"; do
     printf '%s -> %s\n' "$key" "$value"
done

I don't have any current interest in implementing the zsh mini-language for
expansion modifier flags. If someone wanted to take a run at it, I'd be
interested in seeing the results.

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