]>
Commit | Line | Data |
---|---|---|
bb70624e JA |
1 | ./array.tests: array assign: line 10: syntax error near unexpected token `&' |
2 | ./array.tests: array assign: line 10: `first & second' | |
3 | 1 | |
ccc6cda3 | 4 | abcde |
d166f048 | 5 | abcde |
ccc6cda3 JA |
6 | abcde bdef |
7 | abcde bdef | |
8 | declare -a DIRSTACK='()' | |
9 | declare -a a='([0]="abcde" [1]="" [2]="bdef")' | |
10 | declare -a b='()' | |
11 | declare -ar c='()' | |
12 | abcde bdef | |
13 | abcde bdef | |
14 | abcde | |
15 | abcde | |
16 | abcde | |
17 | ||
18 | bdef | |
19 | hello world | |
20 | 11 | |
21 | 3 | |
22 | bdef hello world test expression | |
23 | ./array.tests: readonly: `a[5]': not a valid identifier | |
24 | declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")' | |
25 | declare -ar c='()' | |
26 | declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")' | |
27 | declare -ar c='()' | |
cce855bc JA |
28 | readonly -a a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")' |
29 | readonly -a c='()' | |
ccc6cda3 JA |
30 | ./array.tests: declare: e: cannot assign to array variables in this way |
31 | a test | |
32 | declare -a DIRSTACK='()' | |
33 | declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")' | |
34 | declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")' | |
35 | declare -ar c='()' | |
36 | declare -a d='([1]="" [2]="bdef" [5]="hello world" [6]="test" [9]="ninth element")' | |
37 | declare -a e='([0]="test")' | |
38 | declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")' | |
39 | ./array.tests: a: readonly variable | |
40 | ./array.tests: b[]: bad array subscript | |
41 | ./array.tests: b[*]: bad array subscript | |
42 | ./array.tests: ${b[ ]}: bad substitution | |
43 | ./array.tests: c[-2]: bad array subscript | |
44 | ./array.tests: c: bad array subscript | |
45 | ||
46 | ./array.tests: d[7]: cannot assign list to array member | |
47 | ./array.tests: []=abcde: bad array subscript | |
48 | ./array.tests: [*]=last: cannot assign to non-numeric index | |
49 | ./array.tests: [-65]=negative: bad array subscript | |
50 | declare -a DIRSTACK='()' | |
51 | declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")' | |
52 | declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")' | |
53 | declare -ar c='()' | |
e8ce775d | 54 | declare -a d='([1]="test test")' |
ccc6cda3 JA |
55 | declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")' |
56 | ./array.tests: unset: ps1: not an array variable | |
57 | ./array.tests: declare: c: cannot destroy array variables in this way | |
58 | this of | |
59 | this is a test of read using arrays | |
cce855bc JA |
60 | this test |
61 | this is a test of arrays | |
ccc6cda3 | 62 | declare -a DIRSTACK='()' |
ccc6cda3 JA |
63 | declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")' |
64 | declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")' | |
65 | declare -ar c='()' | |
e8ce775d | 66 | declare -a d='([1]="test test")' |
ccc6cda3 | 67 | declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")' |
d166f048 | 68 | declare -a rv='([0]="this" [1]="is" [2]="a" [3]="test" [4]="of" [5]="read" [6]="using" [7]="arrays")' |
ccc6cda3 JA |
69 | abde |
70 | abde | |
71 | bbb | |
72 | efgh | |
73 | wxyz | |
74 | wxyz | |
75 | ./array.tests | |
76 | a | |
77 | b c | |
78 | d | |
79 | e f g | |
80 | h | |
81 | ./array.tests | |
82 | a | |
83 | b c | |
84 | d | |
85 | e f g | |
86 | h | |
d166f048 JA |
87 | /bin /usr/bin /usr/ucb /usr/local/bin . /sbin /usr/sbin |
88 | bin bin ucb bin . sbin sbin | |
89 | bin | |
90 | / / / / / / | |
91 | / | |
92 | \bin \usr/bin \usr/ucb \usr/local/bin . \sbin \usr/sbin | |
93 | \bin \usr\bin \usr\ucb \usr\local\bin . \sbin \usr\sbin | |
94 | \bin \usr\bin \usr\ucb \usr\local\bin . \sbin \usr\sbin | |
95 | 4 -- 4 | |
96 | 7 -- 7 | |
97 | 55 | |
98 | 49 | |
99 | 6 -- 6 | |
100 | 42 14 44 | |
101 | grep [ 123 ] * | |
102 | 6 7 9 | |
103 | 6 7 9 5 | |
cce855bc JA |
104 | length = 3 |
105 | value = new1 new2 new3 | |
d166f048 | 106 | ./array.tests: narray: unbound variable |
bb70624e JA |
107 | |
108 | a b c d e f g | |
109 | for case if then else | |
110 | <> < > ! | |
111 | 12 14 16 18 20 | |
112 | 4414758999202 | |
28ef6c31 JA |
113 | aaa bbb |
114 | ./array.tests: array assign: line 262: syntax error near unexpected token `for' | |
115 | ./array.tests: array assign: line 262: `a b c for case if then else' | |
116 | ./array.tests: array assign: line 264: syntax error near unexpected token `for' | |
117 | ./array.tests: array assign: line 264: `for case if then else' | |
118 | ./array.tests: array assign: line 266: syntax error near unexpected token `<>' | |
119 | ./array.tests: array assign: line 266: ` <> < > ! ' | |
120 | ./array.tests: array assign: line 267: syntax error near unexpected token `[1]=<>' | |
121 | ./array.tests: array assign: line 267: ` [1]=<> [2]=< [3]=> [4]=! ' | |
122 | abc 3 | |
123 | 0 | |
124 | abc 1 | |
125 | abc 1 | |
126 | 0 | |
127 | 0 | |
128 | 1 | |
129 | 1 |