Imported from ../bash-2.05b.tar.gz.
[platform/upstream/bash.git] / tests / array.right
1
2 ./array.tests: line 15: syntax error near unexpected token `&'
3 ./array.tests: line 15: `test=(first & second)'
4 1
5 abcde
6 abcde
7 abcde bdef
8 abcde bdef
9 declare -a DIRSTACK='()'
10 declare -a a='([0]="abcde" [1]="" [2]="bdef")'
11 declare -a b='()'
12 declare -ar c='()'
13 abcde bdef
14 abcde bdef
15 abcde
16 abcde
17 abcde
18
19 bdef
20 hello world
21 11
22 3
23 bdef hello world test expression
24 ./array.tests: line 74: readonly: `a[5]': not a valid identifier
25 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
26 declare -ar c='()'
27 declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
28 declare -ar c='()'
29 readonly -a a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
30 readonly -a c='()'
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: line 98: a: readonly variable
40 ./array.tests: line 100: b[]: bad array subscript
41 ./array.tests: line 101: b[*]: bad array subscript
42 ./array.tests: line 102: ${b[   ]}: bad substitution
43 ./array.tests: line 104: c[-2]: bad array subscript
44 ./array.tests: line 105: c: bad array subscript
45
46 ./array.tests: line 107: d[7]: cannot assign list to array member
47 ./array.tests: line 109: []=abcde: bad array subscript
48 ./array.tests: line 109: [*]=last: cannot assign to non-numeric index
49 ./array.tests: line 109: [-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='()'
54 declare -a d='([1]="test test")'
55 declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'
56 ./array.tests: line 117: unset: ps1: not an array variable
57 ./array.tests: line 121: declare: c: cannot destroy array variables in this way
58 this of
59 this is a test of read using arrays
60 this test
61 this is a test of arrays
62 declare -a DIRSTACK='()'
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='()'
66 declare -a d='([1]="test test")'
67 declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'
68 declare -a rv='([0]="this" [1]="is" [2]="a" [3]="test" [4]="of" [5]="read" [6]="using" [7]="arrays")'
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
87 /bin /usr/bin /usr/ucb /usr/local/bin . /sbin /usr/sbin
88 bin bin ucb bin . sbin sbin
89 bin
90 / / / / / /
91 /
92 argv[1] = <bin>
93 argv[1] = </>
94 argv[1] = <sbin>
95 argv[1] = </>
96 \bin \usr/bin \usr/ucb \usr/local/bin . \sbin \usr/sbin
97 \bin \usr\bin \usr\ucb \usr\local\bin . \sbin \usr\sbin
98 \bin \usr\bin \usr\ucb \usr\local\bin . \sbin \usr\sbin
99 4 -- 4
100 7 -- 7
101 55
102 49
103 6 -- 6
104 42 14 44
105 grep [ 123 ] *
106 6 7 9
107 6 7 9 5
108 length = 3
109 value = new1 new2 new3
110 ./array.tests: line 237: narray: unbound variable
111
112 a b c d e f g
113 for case if then else
114 <> < > !
115 12 14 16 18 20
116 4414758999202
117 aaa bbb
118 ./array.tests: line 277: syntax error near unexpected token `<>'
119 ./array.tests: line 277: `metas=( <> < > ! )'
120 ./array.tests: line 278: syntax error near unexpected token `<>'
121 ./array.tests: line 278: `metas=( [1]=<> [2]=< [3]=> [4]=! )'
122 abc 3
123 case 4
124 abc case if then else 5
125 abc case if then else 5
126 0
127 case 4
128 case if then else 5
129 case if then else 5