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