bug-bash
[Top][All Lists]
Advanced

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

Funny behaviour of associative arrays


From: n952162
Subject: Funny behaviour of associative arrays
Date: Tue, 27 Jun 2023 07:29:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0

Is this correct?

   declare -A l1

   l1=([a]=b [c]=d)
   echo ${!l1[@]}

   l1=($(echo [a]=b [c]=d))
   echo ${!l1[@]}

$ bash  t4
c a
[a]=b [c]=d

If so, why?  And how can I assign a list of members to an associative array?


reply via email to

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