4 declare -a DIRSTACK='()'
5 declare -a a='([0]="abcde" [1]="" [2]="bdef")'
18 bdef hello world test expression
19 ./array.tests: readonly: `a[5]': not a valid identifier
20 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
22 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
24 ./array.tests: declare: e: cannot assign to array variables in this way
26 declare -a DIRSTACK='()'
27 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
28 declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
30 declare -a d='([1]="" [2]="bdef" [5]="hello world" [6]="test" [9]="ninth element")'
31 declare -a e='([0]="test")'
32 declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'
33 ./array.tests: a: readonly variable
34 ./array.tests: b[]: bad array subscript
35 ./array.tests: b[*]: bad array subscript
36 ./array.tests: ${b[ ]}: bad substitution
37 ./array.tests: c[-2]: bad array subscript
38 ./array.tests: c: bad array subscript
40 ./array.tests: d[7]: cannot assign list to array member
41 ./array.tests: []=abcde: bad array subscript
42 ./array.tests: [*]=last: cannot assign to non-numeric index
43 ./array.tests: [-65]=negative: bad array subscript
44 declare -a DIRSTACK='()'
45 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
46 declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
48 declare -a d='([1]="test test" [2]="bdef" [5]="hello world" [6]="test" [9]="ninth element")'
49 declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'
50 ./array.tests: unset: ps1: not an array variable
51 ./array.tests: declare: c: cannot destroy array variables in this way
53 this is a test of read using arrays
54 declare -a DIRSTACK='()'
55 declare -a rv='([0]="this" [1]="is" [2]="a" [3]="test" [4]="of" [5]="read" [6]="using" [7]="arrays")'
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" [2]="bdef" [5]="hello world" [6]="test" [9]="ninth element")'
60 declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'