blob: c4f8cad4338392a9d9d6f3420e4c8787ef19dca2 [file] [log] [blame]
Chet Rameyac50fba2014-02-26 09:36:43 -05001# 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[@]}