Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15188 > unrolled thread

Re: Unexpected result of array assignment

Started byAndreas Schwab <schwab@suse.de>
First post2019-07-18 11:19 +0200
Last post2019-07-18 11:19 +0200
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Unexpected result of array assignment Andreas Schwab <schwab@suse.de> - 2019-07-18 11:19 +0200

#15188 — Re: Unexpected result of array assignment

FromAndreas Schwab <schwab@suse.de>
Date2019-07-18 11:19 +0200
SubjectRe: Unexpected result of array assignment
Message-ID<mailman.1634.1563441578.2688.bug-bash@gnu.org>
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."

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web