1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
declare -A assoc=(["x],b[\$(echo uname >&2)"]="1" )
declare -A assoc=(["\$key"]="1" ["x],b[\$(echo uname >&2)"]="1" )
declare -A assoc=(["\$key"]="1" ["x],b[\$(echo uname >&2)"]="2" )
./quotearray.tests: line 31: ((: 'assoc[x\],b\[\$(echo uname >&2)]++' : syntax error: operand expected (error token is "'assoc[x\],b\[\$(echo uname >&2)]++' ")
declare -A assoc=(["\$key"]="1" ["x],b[\$(echo uname >&2)"]="2" )
./quotearray.tests: line 34: ((: 'assoc[x\],b\[\$(echo uname >&2)]'++ : syntax error: operand expected (error token is "'assoc[x\],b\[\$(echo uname >&2)]'++ ")
declare -A assoc=(["\$key"]="1" ["x],b[\$(echo uname >&2)"]="2" )
declare -A assoc=(["\$key"]="1" ["x],b[\$(echo uname >&2)"]="3" )
4
klmnopqrst
klmnopqrst
klmno
klmnopqrst
declare -A A=(["\$(echo %)"]="5" [%]="10" ["]"]="10" )
declare -A A=(["~"]="42" )
42
declare -A A=(["~"]="43" )
42
declare -A A=(["~"]="43" ["~0"]="43" )
12
declare -a a=([0]="12" [1]="42")
2
2
declare -Ai assoc=(["']"]="3" ["\$var"]="1" )
105
declare -A assoc=(["\` echo >&2 foo\`"]="42" ["\$( echo >&2 bar)"]="63" )
./quotearray.tests: line 140: x],b[$(echo uname >&2): syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
./quotearray.tests: line 144: x],b[$(echo uname >&2): syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
1
./quotearray.tests: line 147: x],b[$(echo uname >&2): syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
1
./quotearray.tests: line 150: x],b[$(echo uname >&2): syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
1
./quotearray.tests: line 153: x],b[$(echo uname >&2): syntax error: invalid arithmetic operator (error token is "],b[$(echo uname >&2)")
1
declare -A assoc
0
0
1
0
0
0
declare -A assoc=(["\` echo >&2 foo\`"]="128" [0]="0" ["]"]="12" ["x],b[\$(echo uname >&2)"]="42" ["~"]="42" ["\$( echo 2>& date)"]="foo" )
foo
0
0
./quotearray1.sub: line 68: 0\],b\[1: syntax error: invalid arithmetic operator (error token is "\],b\[1")
declare -a array
0
0
0
0
1
1
declare -A aa=(["\$( echo 2>& date)"]="foo" )
foo
0
1
1
./quotearray1.sub: line 113: test: aa[$(echo: binary operator expected
2
[[ -v assoc[a] ]]; $?=0
[[ -v assoc["] ]]; $?=0
declare -A assoc=(["\""]="123" [a]="123" )
declare -A a=([1]="1" [0]="0" [" "]="11" )
7
7
declare -A A=([$'\t']="2" [" "]="2" )
declare -A A=([$'\t']="2" ["*"]="2" [" "]="2" ["]"]="2" ["@"]="2" )
./quotearray2.sub: line 54: read: `A[]]': not a valid identifier
declare -A A=([$'\t']="X" ["*"]="X" [" "]="X" ["@"]="X" )
./quotearray2.sub: line 62: printf: `A[]]': not a valid identifier
declare -A A=([$'\t']="X" ["*"]="X" [" "]="X" ["@"]="X" )
./quotearray2.sub: line 70: declare: `A[]]=X': not a valid identifier
declare -A A=(["*"]="X" ["@"]="X" )
./quotearray2.sub: line 78: declare: `A[]]=X': not a valid identifier
declare -A A=(["*"]="X" ["@"]="X" )
./quotearray2.sub: line 89: let: assoc[x],b[$(echo: bad array subscript (error token is "b[$(echo")
declare -A assoc
declare -A assoc=(["\$(echo foo)"]="1" )
0
declare -A assoc=(["\$var"]="value" )
declare -A assoc=(["\$var"]="value" )
declare -A assoc=(["\$var"]="value" )
declare -A assoc=()
declare -A a=(["\$(echo foo)"]="1" )
declare -A a=()
declare -A a=(["\$(echo foo)"]="1" )
declare -A a=(["\$(echo foo)"]="1" )
declare -A assoc=(["!"]="bang" )
1
1
declare -A assoc=(["!"]="bang" ["@"]="at" )
declare -A assoc=(["!"]="bang" )
declare -a array=([0]="1" [1]="2" [2]="3")
declare -a array=()
./quotearray3.sub: line 98: declare: array: not found
declare -A map=(["foo\$(uname >/dev/tty)bar"]="1" )
1
declare -A map=()
$(DOESNOTEXIST)
declare -A blah=()
declare -A assoc=(["*"]="star" ["!"]="bang" ["@"]="at" )
declare -A assoc=(["*"]="star" ["!"]="bang" )
declare -A assoc=(["!"]="bang" )
./quotearray4.sub: line 41: declare: assoc: not found
declare -A assoc=(["*"]="star" ["!"]="bang" ["@"]="at" )
declare -A assoc=(["*"]="star" ["!"]="bang" )
declare -A assoc=(["!"]="bang" )
declare -A assoc=(["*"]="star" ["!"]="bang" )
declare -A assoc=(["!"]="bang" )
star bang at
star bang at
0
0
0
1
1
declare -A assoc=(["*"]="star" ["!"]="bang" ["@"]=" key" )
===
1
1
declare -a array=([0]="1" [1]="2" [2]="3")
1 2 3
1 2 3
0
0
./quotearray4.sub: line 115: array[@]: bad array subscript
declare -a array=([0]="1" [1]="2" [2]="3")
./quotearray5.sub: line 27: unset: `a[$(echo': not a valid identifier
./quotearray5.sub: line 27: unset: `foo)]': not a valid identifier
declare -A a=()
declare -A a=()
declare -A a=()
-----
declare -A a=(["\$(echo foo)"]="1" )
declare -A a=()
declare -A a=()
declare -A a=()
-----
declare -A a=()
declare -A a=()
declare -A a=()
----------
declare -A a=([.]="v1" )
declare -A a=([.]="v1" )
-----
declare -A a=([.]="v1" )
declare -A a=([.]="v1" )
-----
declare -A a=([.]="v1" )
declare -A a=([.]="v1" )
|