]> git.ipfire.org Git - thirdparty/bash.git/blob - tests/assoc6.sub
Bash-5.2-rc4 release
[thirdparty/bash.git] / tests / assoc6.sub
1 # This program is free software: you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation, either version 3 of the License, or
4 # (at your option) any later version.
5 #
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 # GNU General Public License for more details.
10 #
11 # You should have received a copy of the GNU General Public License
12 # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 #
14 declare -A foo
15
16 foo=([bar\"bie]=doll)
17
18 echo ${!foo[@]}
19 echo ${foo[@]}
20
21 declare -p foo
22
23 unset foo
24 declare -A foo=(["bar\"bie"]="doll")
25
26 echo ${!foo[@]}
27 echo ${foo[@]}
28
29 declare -p foo
30
31 unset foo
32 declare -A foo
33
34 foo=(["bar\"bie"]="doll")
35
36 echo ${!foo[@]}
37 echo ${foo[@]}
38
39 declare -p foo
40
41 unset foo
42 declare -A foo
43
44 foo["bar\"bie"]="doll"
45
46 echo ${!foo[@]}
47 echo ${foo[@]}
48
49 declare -p foo
50
51 unset foo
52 declare -A foo
53
54 foo[bar\"bie]="doll"
55
56 echo ${!foo[@]}
57 echo ${foo[@]}
58
59 declare -p foo
60
61 unset foo
62 declare -A foo
63
64 foo=([bar\'bie]=doll)
65
66 echo ${!foo[@]}
67 echo ${foo[@]}
68
69 declare -p foo
70
71 unset foo
72 declare -A foo=(["bar'bie"]="doll")
73
74 echo ${!foo[@]}
75 echo ${foo[@]}
76
77 declare -p foo
78
79 unset foo
80 declare -A foo
81
82 foo=(["bar'bie"]="doll")
83
84 echo ${!foo[@]}
85 echo ${foo[@]}
86
87 declare -p foo
88
89 unset foo
90 declare -A foo
91
92 foo["bar'bie"]="doll"
93
94 echo ${!foo[@]}
95 echo ${foo[@]}
96
97 declare -p foo
98
99 unset foo
100 declare -A foo
101
102 foo[bar\'bie]="doll"
103
104 echo ${!foo[@]}
105 echo ${foo[@]}
106
107 declare -p foo
108
109 unset foo
110 declare -A foo
111
112 foo=([bar\$bie]=doll)
113
114 echo ${!foo[@]}
115 echo ${foo[@]}
116
117 declare -p foo
118
119 unset foo
120 declare -A foo=(["bar[bie"]="doll")
121
122 echo ${!foo[@]}
123 echo ${foo[@]}
124
125 declare -p foo
126
127 unset foo
128 declare -A foo
129
130 foo=(["bar\`bie"]="doll")
131
132 echo ${!foo[@]}
133 echo ${foo[@]}
134
135 declare -p foo
136
137 unset foo
138 declare -A foo
139
140 # this doesn't work right without the backslash
141 foo["bar\]bie"]="doll"
142
143 echo ${!foo[@]}
144 echo ${foo[@]}
145
146 declare -p foo
147
148 unset foo
149 declare -A foo
150
151 foo[bar\${foo}bie]="doll"
152
153 echo ${!foo[@]}
154 echo ${foo[@]}
155
156 declare -p foo
157
158 unset foo
159 declare -A foo