1
2./array.tests: line 15: syntax error near unexpected token `&'
3./array.tests: line 15: `test=(first & second)'
41
5abcde
6abcde
7abcde bdef
8abcde bdef
9declare -a BASH_ARGC='()'
10declare -a BASH_ARGV='()'
11declare -a BASH_LINENO='([0]="0")'
12declare -a BASH_SOURCE='([0]="./array.tests")'
13declare -a DIRSTACK='()'
14declare -a FUNCNAME='([0]="main")'
15declare -a a='([0]="abcde" [1]="" [2]="bdef")'
16declare -a b='()'
17declare -ar c='()'
18abcde bdef
19abcde bdef
20abcde
21abcde
22abcde
23
24bdef
25hello world
2611
273
28bdef hello world test expression
29./array.tests: line 74: readonly: `a[5]': not a valid identifier
30declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
31declare -ar c='()'
32declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
33declare -ar c='()'
34readonly -a a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
35readonly -a c='()'
36a test
37declare -a BASH_ARGC='()'
38declare -a BASH_ARGV='()'
39declare -a BASH_LINENO='([0]="0")'
40declare -a BASH_SOURCE='([0]="./array.tests")'
41declare -a DIRSTACK='()'
42declare -a FUNCNAME='([0]="main")'
43declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
44declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
45declare -ar c='()'
46declare -a d='([1]="" [2]="bdef" [5]="hello world" [6]="test" [9]="ninth element")'
47declare -a e='([0]="test")'
48declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'
49./array.tests: line 98: a: readonly variable
50./array.tests: line 100: b[]: bad array subscript
51./array.tests: line 101: b[*]: bad array subscript
52./array.tests: line 102: ${b[   ]}: bad substitution
53./array.tests: line 104: c[-2]: bad array subscript
54./array.tests: line 105: c: bad array subscript
55
56./array.tests: line 107: d[7]: cannot assign list to array member
57./array.tests: line 109: []=abcde: bad array subscript
58./array.tests: line 109: [*]=last: cannot assign to non-numeric index
59./array.tests: line 109: [-65]=negative: bad array subscript
60declare -a BASH_ARGC='()'
61declare -a BASH_ARGV='()'
62declare -a BASH_LINENO='([0]="0")'
63declare -a BASH_SOURCE='([0]="./array.tests")'
64declare -a DIRSTACK='()'
65declare -a FUNCNAME='([0]="main")'
66declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
67declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
68declare -ar c='()'
69declare -a d='([1]="test test")'
70declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'
71./array.tests: line 117: unset: ps1: not an array variable
72./array.tests: line 121: declare: c: cannot destroy array variables in this way
73this of
74this is a test of read using arrays
75this test
76this is a test of arrays
77declare -a BASH_ARGC='()'
78declare -a BASH_ARGV='()'
79declare -a BASH_LINENO='([0]="0")'
80declare -a BASH_SOURCE='([0]="./array.tests")'
81declare -a DIRSTACK='()'
82declare -a FUNCNAME='([0]="main")'
83declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
84declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
85declare -ar c='()'
86declare -a d='([1]="test test")'
87declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'
88declare -a rv='([0]="this" [1]="is" [2]="a" [3]="test" [4]="of" [5]="read" [6]="using" [7]="arrays")'
89abde
90abde
91bbb
92efgh
93wxyz
94wxyz
95./array.tests
96a
97b c
98d
99e f g
100h
101./array.tests
102a
103b c
104d
105e f g
106h
107/bin /usr/bin /usr/ucb /usr/local/bin . /sbin /usr/sbin
108bin bin ucb bin . sbin sbin
109bin
110/ / / / / /
111/
112argv[1] = <bin>
113argv[1] = </>
114argv[1] = <sbin>
115argv[1] = </>
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
1194 -- 4
1207 -- 7
12155
12249
1236 -- 6
12442 14 44
125grep [ 123 ] *
1266 7 9
1276 7 9 5
128length = 3
129value = new1 new2 new3
130./array.tests: line 237: 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: syntax error near unexpected token `('
134./array2.sub: line 1: `declare -a ''=(a 'b c')'
1359
1369
137
138
1397 8 9
1408 11
1418 11
1426
1436
144nordholz
1458
1468
1478
148
149a b c d e f g
150for case if then else
151<> < > !
15212 14 16 18 20
1534414758999202
154aaa bbb
155./array.tests: line 285: syntax error near unexpected token `<>'
156./array.tests: line 285: `metas=( <> < > ! )'
157./array.tests: line 286: syntax error near unexpected token `<>'
158./array.tests: line 286: `metas=( [1]=<> [2]=< [3]=> [4]=! )'
159abc 3
160case 4
161abc case if then else 5
162abc case if then else 5
1630
164case 4
165case if then else 5
166case if then else 5
167argv[1] = <0>
168argv[2] = <1>
169argv[3] = <4>
170argv[4] = <10>
171argv[1] = <0>
172argv[2] = <1>
173argv[3] = <4>
174argv[4] = <10>
175argv[1] = <0>
176argv[2] = <1>
177argv[3] = <4>
178argv[4] = <10>
179argv[1] = <0 1 4 10>
180include null element -- expect one
181one
182include unset element -- expect three five
183three five
184start at unset element -- expect five seven
185five seven
186too many elements -- expect three five seven
187three five seven
188positive offset - expect five seven
189five seven
190negative offset to unset element - expect seven
191seven
192positive offset 2 - expect seven
193seven
194negative offset 2 - expect seven
195seven
196out-of-range offset
197
198e
1994
2001 4 7 10
201'b
202b  c
203$0
204t
205[3]=abcde r s t u v
206e
2079
2082
209