Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15184 > unrolled thread
| Started by | Darren 'Tadgy' Austin <darren@afterdark.org.uk> |
|---|---|
| First post | 2019-07-18 02:16 +0100 |
| Last post | 2019-07-18 02:16 +0100 |
| 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.
Unexpected result of array assignment Darren 'Tadgy' Austin <darren@afterdark.org.uk> - 2019-07-18 02:16 +0100
| From | Darren 'Tadgy' Austin <darren@afterdark.org.uk> |
|---|---|
| Date | 2019-07-18 02:16 +0100 |
| Subject | Unexpected result of array assignment |
| Message-ID | <mailman.1618.1563426353.2688.bug-bash@gnu.org> |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/bash-LQgi2O/bash-5.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-parentheses -Wno-format-security
uname output: Linux phil 5.0.0-13-generic #14-Ubuntu SMP Mon Apr 15 14:59:14 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu
Bash Version: 5.0
Patch Level: 3
Release Status: release
Description:
There seems to be unexpect (a bug?) behaviour with bash's handling of array assignments.
Specifically, if you try to assign an array element a value containing that same array value, it fails to work.
See example below :)
Bug confirmed by the folks in #bash on Freenode - unable to explain what is happening.
Repeat-By:
declare -A foo
foo=(["key"]="value1")
declare -p foo
foo=(["key"]="${foo["key"]} value2")
declare -p foo
The above should result in 'foo["key"]' having a value of 'value1 value2', but the result is simply ' value2', which I believe to be incorrect behaviour.
Back to top | Article view | gnu.bash.bug
csiph-web