[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unexpected result of array assignment
From: |
Andreas Schwab |
Subject: |
Re: Unexpected result of array assignment |
Date: |
Thu, 18 Jul 2019 11:19:29 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) |
On Jul 18 2019, Henning <xaoxx@t-online.de> wrote:
> On 18/07/2019 03:16, Darren 'Tadgy' Austin wrote:
>
>> foo=(["key"]="${foo["key"]} value2")
>
> using eval shoud also succeed, even for older bash:
>
> eval 'foo=(["key"]="'"${foo["key"]}"' value2")'
This will break if ${foo["key"]} contains any of $ ` " \ <newline>.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."