5 declare -a DIRSTACK='()'
6 declare -a a='([0]="abcde" [1]="" [2]="bdef")'
19 bdef hello world test expression
20 ./array.tests: readonly: `a[5]': not a valid identifier
21 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
23 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
25 ./array.tests: declare: e: cannot assign to array variables in this way
27 declare -a DIRSTACK='()'
28 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
29 declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
31 declare -a d='([1]="" [2]="bdef" [5]="hello world" [6]="test" [9]="ninth element")'
32 declare -a e='([0]="test")'
33 declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'
34 ./array.tests: a: readonly variable
35 ./array.tests: b[]: bad array subscript
36 ./array.tests: b[*]: bad array subscript
37 ./array.tests: ${b[ ]}: bad substitution
38 ./array.tests: c[-2]: bad array subscript
39 ./array.tests: c: bad array subscript
41 ./array.tests: d[7]: cannot assign list to array member
42 ./array.tests: []=abcde: bad array subscript
43 ./array.tests: [*]=last: cannot assign to non-numeric index
44 ./array.tests: [-65]=negative: bad array subscript
45 declare -a DIRSTACK='()'
46 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
47 declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
49 declare -a d='([1]="test test")'
50 declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'
51 ./array.tests: unset: ps1: not an array variable
52 ./array.tests: declare: c: cannot destroy array variables in this way
54 this is a test of read using arrays
55 declare -a DIRSTACK='()'
56 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
57 declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
59 declare -a d='([1]="test test")'
60 declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'
61 declare -a rv='([0]="this" [1]="is" [2]="a" [3]="test" [4]="of" [5]="read" [6]="using" [7]="arrays")'
80 /bin /usr/bin /usr/ucb /usr/local/bin . /sbin /usr/sbin
81 bin bin ucb bin . sbin sbin
85 \bin \usr/bin \usr/ucb \usr/local/bin . \sbin \usr/sbin
86 \bin \usr\bin \usr\ucb \usr\local\bin . \sbin \usr\sbin
87 \bin \usr\bin \usr\ucb \usr\local\bin . \sbin \usr\sbin
97 ./array.tests: narray: unbound variable