]>
Commit | Line | Data |
---|---|---|
7117c2d2 JA |
1 | |
2 | ./array.tests: line 15: syntax error near unexpected token `&' | |
3 | ./array.tests: line 15: `test=(first & second)' | |
bb70624e | 4 | 1 |
ccc6cda3 | 5 | abcde |
d166f048 | 6 | abcde |
ccc6cda3 JA |
7 | abcde bdef |
8 | abcde bdef | |
b80f6443 JA |
9 | declare -a BASH_ARGC='()' |
10 | declare -a BASH_ARGV='()' | |
11 | declare -a BASH_LINENO='([0]="0")' | |
12 | declare -a BASH_SOURCE='([0]="./array.tests")' | |
ccc6cda3 | 13 | declare -a DIRSTACK='()' |
b80f6443 | 14 | declare -a FUNCNAME='([0]="main")' |
ccc6cda3 JA |
15 | declare -a a='([0]="abcde" [1]="" [2]="bdef")' |
16 | declare -a b='()' | |
17 | declare -ar c='()' | |
18 | abcde bdef | |
19 | abcde bdef | |
20 | abcde | |
21 | abcde | |
22 | abcde | |
23 | ||
24 | bdef | |
25 | hello world | |
26 | 11 | |
27 | 3 | |
0001803f CR |
28 | bdef hello world test expression test 2 |
29 | ./array.tests: line 76: readonly: `a[5]': not a valid identifier | |
30 | declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")' | |
ccc6cda3 | 31 | declare -ar c='()' |
0001803f | 32 | declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")' |
ccc6cda3 | 33 | declare -ar c='()' |
0001803f | 34 | readonly -a a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")' |
cce855bc | 35 | readonly -a c='()' |
ccc6cda3 | 36 | a test |
b80f6443 JA |
37 | declare -a BASH_ARGC='()' |
38 | declare -a BASH_ARGV='()' | |
39 | declare -a BASH_LINENO='([0]="0")' | |
40 | declare -a BASH_SOURCE='([0]="./array.tests")' | |
ccc6cda3 | 41 | declare -a DIRSTACK='()' |
b80f6443 | 42 | declare -a FUNCNAME='([0]="main")' |
0001803f | 43 | declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")' |
ccc6cda3 JA |
44 | declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")' |
45 | declare -ar c='()' | |
46 | declare -a d='([1]="" [2]="bdef" [5]="hello world" [6]="test" [9]="ninth element")' | |
47 | declare -a e='([0]="test")' | |
48 | declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")' | |
0001803f CR |
49 | ./array.tests: line 100: a: readonly variable |
50 | ./array.tests: line 102: b[]: bad array subscript | |
51 | ./array.tests: line 103: b[*]: bad array subscript | |
52 | ./array.tests: line 104: ${b[ ]}: bad substitution | |
53 | ./array.tests: line 106: c[-2]: bad array subscript | |
54 | ./array.tests: line 107: c: bad array subscript | |
ccc6cda3 | 55 | |
0001803f CR |
56 | ./array.tests: line 109: d[7]: cannot assign list to array member |
57 | ./array.tests: line 111: []=abcde: bad array subscript | |
58 | ./array.tests: line 111: [*]=last: cannot assign to non-numeric index | |
59 | ./array.tests: line 111: [-65]=negative: bad array subscript | |
b80f6443 JA |
60 | declare -a BASH_ARGC='()' |
61 | declare -a BASH_ARGV='()' | |
62 | declare -a BASH_LINENO='([0]="0")' | |
63 | declare -a BASH_SOURCE='([0]="./array.tests")' | |
ccc6cda3 | 64 | declare -a DIRSTACK='()' |
b80f6443 | 65 | declare -a FUNCNAME='([0]="main")' |
0001803f | 66 | declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")' |
ccc6cda3 JA |
67 | declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")' |
68 | declare -ar c='()' | |
e8ce775d | 69 | declare -a d='([1]="test test")' |
ccc6cda3 | 70 | declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")' |
0001803f CR |
71 | ./array.tests: line 119: unset: ps1: not an array variable |
72 | ./array.tests: line 123: declare: c: cannot destroy array variables in this way | |
ccc6cda3 JA |
73 | this of |
74 | this is a test of read using arrays | |
cce855bc JA |
75 | this test |
76 | this is a test of arrays | |
b80f6443 JA |
77 | declare -a BASH_ARGC='()' |
78 | declare -a BASH_ARGV='()' | |
79 | declare -a BASH_LINENO='([0]="0")' | |
80 | declare -a BASH_SOURCE='([0]="./array.tests")' | |
ccc6cda3 | 81 | declare -a DIRSTACK='()' |
b80f6443 | 82 | declare -a FUNCNAME='([0]="main")' |
0001803f | 83 | declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")' |
ccc6cda3 JA |
84 | declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")' |
85 | declare -ar c='()' | |
e8ce775d | 86 | declare -a d='([1]="test test")' |
ccc6cda3 | 87 | declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")' |
d166f048 | 88 | declare -a rv='([0]="this" [1]="is" [2]="a" [3]="test" [4]="of" [5]="read" [6]="using" [7]="arrays")' |
ccc6cda3 JA |
89 | abde |
90 | abde | |
91 | bbb | |
92 | efgh | |
93 | wxyz | |
94 | wxyz | |
95 | ./array.tests | |
96 | a | |
97 | b c | |
98 | d | |
99 | e f g | |
100 | h | |
101 | ./array.tests | |
102 | a | |
103 | b c | |
104 | d | |
105 | e f g | |
106 | h | |
d166f048 JA |
107 | /bin /usr/bin /usr/ucb /usr/local/bin . /sbin /usr/sbin |
108 | bin bin ucb bin . sbin sbin | |
109 | bin | |
110 | / / / / / / | |
111 | / | |
7117c2d2 JA |
112 | argv[1] = <bin> |
113 | argv[1] = </> | |
114 | argv[1] = <sbin> | |
115 | argv[1] = </> | |
d166f048 JA |
116 | \bin \usr/bin \usr/ucb \usr/local/bin . \sbin \usr/sbin |
117 | \bin \usr\bin \usr\ucb \usr\local\bin . \sbin \usr\sbin | |
118 | \bin \usr\bin \usr\ucb \usr\local\bin . \sbin \usr\sbin | |
119 | 4 -- 4 | |
120 | 7 -- 7 | |
121 | 55 | |
122 | 49 | |
123 | 6 -- 6 | |
124 | 42 14 44 | |
125 | grep [ 123 ] * | |
126 | 6 7 9 | |
127 | 6 7 9 5 | |
cce855bc JA |
128 | length = 3 |
129 | value = new1 new2 new3 | |
0001803f | 130 | ./array.tests: line 239: narray: unbound variable |
95732b49 JA |
131 | ./array1.sub: line 1: syntax error near unexpected token `(' |
132 | ./array1.sub: line 1: `printf "%s\n" -a a=(a 'b c')' | |
ac50fbac CR |
133 | ./array2.sub: line 1: declare: `[]=asdf': not a valid identifier |
134 | ./array2.sub: line 2: a[]: bad array subscript | |
135 | ./array2.sub: line 4: syntax error near unexpected token `(' | |
136 | ./array2.sub: line 4: `declare -a ''=(a 'b c')' | |
95732b49 JA |
137 | 9 |
138 | 9 | |
139 | ||
140 | ||
141 | 7 8 9 | |
0628567a JA |
142 | 8 11 |
143 | 8 11 | |
144 | 6 | |
145 | 6 | |
146 | nordholz | |
147 | 8 | |
148 | 8 | |
149 | 8 | |
bb70624e JA |
150 | |
151 | a b c d e f g | |
152 | for case if then else | |
153 | <> < > ! | |
154 | 12 14 16 18 20 | |
155 | 4414758999202 | |
28ef6c31 | 156 | aaa bbb |
0001803f CR |
157 | ./array.tests: line 289: syntax error near unexpected token `<>' |
158 | ./array.tests: line 289: `metas=( <> < > ! )' | |
159 | ./array.tests: line 290: syntax error near unexpected token `<>' | |
160 | ./array.tests: line 290: `metas=( [1]=<> [2]=< [3]=> [4]=! )' | |
28ef6c31 | 161 | abc 3 |
7117c2d2 JA |
162 | case 4 |
163 | abc case if then else 5 | |
164 | abc case if then else 5 | |
28ef6c31 | 165 | 0 |
7117c2d2 JA |
166 | case 4 |
167 | case if then else 5 | |
168 | case if then else 5 | |
b80f6443 JA |
169 | argv[1] = <0> |
170 | argv[2] = <1> | |
171 | argv[3] = <4> | |
172 | argv[4] = <10> | |
173 | argv[1] = <0> | |
174 | argv[2] = <1> | |
175 | argv[3] = <4> | |
176 | argv[4] = <10> | |
177 | argv[1] = <0> | |
178 | argv[2] = <1> | |
179 | argv[3] = <4> | |
180 | argv[4] = <10> | |
181 | argv[1] = <0 1 4 10> | |
182 | include null element -- expect one | |
183 | one | |
184 | include unset element -- expect three five | |
185 | three five | |
186 | start at unset element -- expect five seven | |
187 | five seven | |
188 | too many elements -- expect three five seven | |
189 | three five seven | |
190 | positive offset - expect five seven | |
191 | five seven | |
eb873671 JA |
192 | negative offset to unset element - expect seven |
193 | seven | |
b80f6443 JA |
194 | positive offset 2 - expect seven |
195 | seven | |
196 | negative offset 2 - expect seven | |
197 | seven | |
198 | out-of-range offset | |
199 | ||
95732b49 JA |
200 | e |
201 | 4 | |
202 | 1 4 7 10 | |
203 | 'b | |
204 | b c | |
205 | $0 | |
206 | t | |
207 | [3]=abcde r s t u v | |
208 | e | |
209 | 9 | |
0628567a | 210 | 2 |
3185942a | 211 | a b c |
ac50fbac CR |
212 | argv[1] = <-iname 'a> |
213 | argv[2] = <-iname 'b> | |
214 | argv[3] = <-iname 'c> | |
3185942a JA |
215 | 'hey' |
216 | hey | |
217 | ''hey | |
218 | 'hey' | |
219 | argv[1] = <c> | |
220 | argv[2] = <d> | |
221 | argv[3] = <e> | |
222 | argv[4] = <f> | |
223 | argv[1] = <c d> | |
224 | argv[2] = <e f> | |
225 | argv[1] = <c d> | |
226 | argv[2] = <e f> | |
227 | argv[1] = <c d> | |
228 | argv[2] = <e f> | |
3185942a JA |
229 | argv[1] = <-iname 'abc> |
230 | argv[2] = <-iname 'def> | |
ac50fbac CR |
231 | argv[1] = <-iname 'abc> |
232 | argv[2] = <-iname 'def> | |
3185942a | 233 | argv[1] = <-iname> |
ac50fbac CR |
234 | argv[2] = <abc -iname def> |
235 | argv[1] = <-iname 'abc> | |
236 | argv[2] = <-iname 'def> | |
237 | argv[1] = <-iname> | |
238 | argv[2] = <abc -iname def> | |
239 | argv[1] = <-iname 'abc> | |
240 | argv[2] = <-iname 'def> | |
3185942a JA |
241 | argv[1] = <-iname 'abc> |
242 | argv[2] = <-iname 'def> | |
ac50fbac CR |
243 | argv[1] = <-iname> |
244 | argv[2] = <abc -iname def> | |
3185942a JA |
245 | *.* OK |
246 | 1 | |
247 | a1 2 3c | |
248 | argv[1] = <var with spaces> | |
249 | argv[1] = <var with spaces> | |
250 | argv[1] = <var with spacesab> | |
251 | argv[2] = <cd> | |
252 | argv[3] = <ef> | |
253 | argv[1] = <var with spacesab> | |
254 | argv[2] = <cd> | |
255 | argv[3] = <ef> | |
256 | argv[1] = <var with spacesab> | |
257 | argv[2] = <cd> | |
258 | argv[3] = <ef> | |
259 | argv[1] = <var with spacesab> | |
260 | argv[2] = <cd> | |
261 | argv[3] = <ef> | |
262 | argv[1] = <var with spacesab> | |
263 | argv[2] = <cd> | |
264 | argv[3] = <ef> | |
265 | argv[1] = <var with spacesab> | |
266 | argv[2] = <cd> | |
267 | argv[3] = <ef> | |
268 | 2 | |
269 | argv[1] = <element1 with spaces> | |
270 | argv[2] = <element2 with spaces> | |
271 | argv[1] = <element1 with spaces> | |
272 | argv[2] = <element2 with spaces> | |
273 | nord!olz | |
274 | ||
275 | rdholz | |
276 | ||
277 | rdholz | |
278 | rdho | |
279 | ||
280 | ||
281 | argv[1] = <fooq//barq/> | |
282 | argv[1] = <fooq> | |
283 | argv[2] = <> | |
284 | argv[3] = <barq> | |
285 | argv[4] = <> | |
286 | argv[1] = <foo!//bar!/> | |
287 | argv[1] = <foo!> | |
288 | argv[2] = <> | |
289 | argv[3] = <bar!> | |
290 | argv[4] = <> | |
291 | argv[1] = <ooq//arq/> | |
292 | argv[1] = <ooq> | |
293 | argv[2] = <> | |
294 | argv[3] = <arq> | |
295 | argv[4] = <> | |
296 | argv[1] = <Fooq//Barq/> | |
297 | argv[1] = <Fooq> | |
298 | argv[2] = <> | |
299 | argv[3] = <Barq> | |
300 | argv[4] = <> | |
301 | argv[1] = <FOOQ//BARQ/> | |
302 | argv[1] = <FOOQ> | |
303 | argv[2] = <> | |
304 | argv[3] = <BARQ> | |
305 | argv[4] = <> | |
306 | 126 | |
307 | 127 | |
308 | 128 | |
309 |