2 ./array.tests: line 15: syntax error near unexpected token `&'
3 ./array.tests: line 15: `test=(first & second)'
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")'
13 declare -a DIRSTACK='()'
14 declare -a FUNCNAME='([0]="main")'
15 declare -a a='([0]="abcde" [1]="" [2]="bdef")'
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")'
32 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")'
34 readonly -a a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")'
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")'
41 declare -a DIRSTACK='()'
42 declare -a FUNCNAME='([0]="main")'
43 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")'
44 declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
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")'
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
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
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")'
64 declare -a DIRSTACK='()'
65 declare -a FUNCNAME='([0]="main")'
66 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")'
67 declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
69 declare -a d='([1]="test test")'
70 declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'
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
74 this is a test of read using arrays
76 this is a test of arrays
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")'
81 declare -a DIRSTACK='()'
82 declare -a FUNCNAME='([0]="main")'
83 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression" [15]="test 2")'
84 declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
86 declare -a d='([1]="test test")'
87 declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'
88 declare -a rv='([0]="this" [1]="is" [2]="a" [3]="test" [4]="of" [5]="read" [6]="using" [7]="arrays")'
107 /bin /usr/bin /usr/ucb /usr/local/bin . /sbin /usr/sbin
108 bin bin ucb bin . sbin sbin
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
129 value = new1 new2 new3
130 ./array.tests: line 239: narray: unbound variable
131 ./array1.sub: line 1: syntax error near unexpected token `('
132 ./array1.sub: line 1: `printf "%s\n" -a a=(a 'b c')'
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')'
152 for case if then else
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]=! )'
163 abc case if then else 5
164 abc case if then else 5
182 include null element -- expect one
184 include unset element -- expect three five
186 start at unset element -- expect five seven
188 too many elements -- expect three five seven
190 positive offset - expect five seven
192 negative offset to unset element - expect seven
194 positive offset 2 - expect seven
196 negative offset 2 - expect seven
212 argv[1] = <-iname 'a>
213 argv[2] = <-iname 'b>
214 argv[3] = <-iname 'c>
229 argv[1] = <-iname 'abc>
230 argv[2] = <-iname 'def>
231 argv[1] = <-iname 'abc>
232 argv[2] = <-iname 'def>
234 argv[2] = <abc -iname def>
235 argv[1] = <-iname 'abc>
236 argv[2] = <-iname 'def>
238 argv[2] = <abc -iname def>
239 argv[1] = <-iname 'abc>
240 argv[2] = <-iname 'def>
241 argv[1] = <-iname 'abc>
242 argv[2] = <-iname 'def>
244 argv[2] = <abc -iname def>
248 argv[1] = <var with spaces>
249 argv[1] = <var with spaces>
250 argv[1] = <var with spacesab>
253 argv[1] = <var with spacesab>
256 argv[1] = <var with spacesab>
259 argv[1] = <var with spacesab>
262 argv[1] = <var with spacesab>
265 argv[1] = <var with spacesab>
269 argv[1] = <element1 with spaces>
270 argv[2] = <element2 with spaces>
271 argv[1] = <element1 with spaces>
272 argv[2] = <element2 with spaces>
281 argv[1] = <fooq//barq/>
286 argv[1] = <foo!//bar!/>
291 argv[1] = <ooq//arq/>
296 argv[1] = <Fooq//Barq/>
301 argv[1] = <FOOQ//BARQ/>
319 Monday Tuesday Wednesday Thursday Friday Saturday Sunday
332 monday, monday, tuesday
333 wednesday, wednesday, thursday
334 monday, monday, tuesday
335 Wednesday, Wednesday, Thursday
352 version[agent] foo[bar]
367 declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="5")'
368 declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4")'
369 declare -a x='([0]="0" [1]="1" [2]="2" [4]="4")'
370 ./array14.sub: line 11: [-10]: bad array subscript
371 declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4")'
372 declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="five")'
373 declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="5")'
374 declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="5foo")'
375 declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4" [5]="5")'
376 declare -a x='([0]="0" [1]="1" [2]="2" [3]="3" [4]="4four" [5]="5")'
385 foo: implicit reference to element 0: ok
386 foo: arithmetic evaluation: ok
387 bar: array with element zero unset: ok
388 bar: element zero: ok
390 qux: unset array element 0: ok