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
29 ./array.tests: line 74: readonly: `a[5]': not a valid identifier
30 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
32 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
34 readonly -a a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
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")'
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 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
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
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")'
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 117: unset: ps1: not an array variable
72 ./array.tests: line 121: 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")'
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 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')'
150 for case if then else
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]=! )'
161 abc case if then else 5
162 abc case if then else 5
180 include null element -- expect one
182 include unset element -- expect three five
184 start at unset element -- expect five seven
186 too many elements -- expect three five seven
188 positive offset - expect five seven
190 negative offset to unset element - expect seven
192 positive offset 2 - expect seven
194 negative offset 2 - expect seven