]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/array11.sub
Bash-4.3 patch 7
[thirdparty/bash.git] / tests / array11.sub
CommitLineData
ac50fbac
CR
1# problems with associative array keys with ] and unbalanced [ ]
2# fixed after bash-4.2
3
4declare -A foo
5
6foo=(["version[agent]"]=version.agent)
7
8echo ${!foo[@]}
9echo ${foo[@]}
10
11unset foo
12declare -A foo
13foo["version[agent]"]=version.agent
14
15echo ${!foo[@]}
16echo ${foo[@]}
17
18declare foo["foo[bar]"]=bowl
19
20echo ${!foo[@]}
21echo ${foo[@]}
22
23declare -A array2["foo[bar]"]=bleh
24
25array2["foobar]"]=bleh
26array2["foo"]=bbb
27
28echo ${!array2[@]}
29echo ${array2[@]}
30
31declare -A foo
32foo=( ['ab]']=bar )
33
34echo ${!foo[@]}
35echo ${foo[@]}