source: vendor/bash/3.1-p17/tests/array.right

Last change on this file was 3228, checked in by bird, 18 years ago

bash 3.1

File size: 5.1 KB
Line 
1
2./array.tests: line 15: syntax error near unexpected token `&'
3./array.tests: line 15: `test=(first & second)'
41
5abcde
6abcde
7abcde bdef
8abcde bdef
9declare -a BASH_ARGC='()'
10declare -a BASH_ARGV='()'
11declare -a BASH_LINENO='([0]="0")'
12declare -a BASH_SOURCE='([0]="./array.tests")'
13declare -a DIRSTACK='()'
14declare -a FUNCNAME='([0]="main")'
15declare -a a='([0]="abcde" [1]="" [2]="bdef")'
16declare -a b='()'
17declare -ar c='()'
18abcde bdef
19abcde bdef
20abcde
21abcde
22abcde
23
24bdef
25hello world
2611
273
28bdef hello world test expression
29./array.tests: line 74: readonly: `a[5]': not a valid identifier
30declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
31declare -ar c='()'
32declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
33declare -ar c='()'
34readonly -a a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
35readonly -a c='()'
36a test
37declare -a BASH_ARGC='()'
38declare -a BASH_ARGV='()'
39declare -a BASH_LINENO='([0]="0")'
40declare -a BASH_SOURCE='([0]="./array.tests")'
41declare -a DIRSTACK='()'
42declare -a FUNCNAME='([0]="main")'
43declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
44declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
45declare -ar c='()'
46declare -a d='([1]="" [2]="bdef" [5]="hello world" [6]="test" [9]="ninth element")'
47declare -a e='([0]="test")'
48declare -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
55
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
60declare -a BASH_ARGC='()'
61declare -a BASH_ARGV='()'
62declare -a BASH_LINENO='([0]="0")'
63declare -a BASH_SOURCE='([0]="./array.tests")'
64declare -a DIRSTACK='()'
65declare -a FUNCNAME='([0]="main")'
66declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
67declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
68declare -ar c='()'
69declare -a d='([1]="test test")'
70declare -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
73this of
74this is a test of read using arrays
75this test
76this is a test of arrays
77declare -a BASH_ARGC='()'
78declare -a BASH_ARGV='()'
79declare -a BASH_LINENO='([0]="0")'
80declare -a BASH_SOURCE='([0]="./array.tests")'
81declare -a DIRSTACK='()'
82declare -a FUNCNAME='([0]="main")'
83declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
84declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
85declare -ar c='()'
86declare -a d='([1]="test test")'
87declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'
88declare -a rv='([0]="this" [1]="is" [2]="a" [3]="test" [4]="of" [5]="read" [6]="using" [7]="arrays")'
89abde
90abde
91bbb
92efgh
93wxyz
94wxyz
95./array.tests
96a
97b c
98d
99e f g
100h
101./array.tests
102a
103b c
104d
105e f g
106h
107/bin /usr/bin /usr/ucb /usr/local/bin . /sbin /usr/sbin
108bin bin ucb bin . sbin sbin
109bin
110/ / / / / /
111/
112argv[1] = <bin>
113argv[1] = </>
114argv[1] = <sbin>
115argv[1] = </>
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
1194 -- 4
1207 -- 7
12155
12249
1236 -- 6
12442 14 44
125grep [ 123 ] *
1266 7 9
1276 7 9 5
128length = 3
129value = 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')'
1359
1369
137
138
1397 8 9
140
141a b c d e f g
142for case if then else
143<> < > !
14412 14 16 18 20
1454414758999202
146aaa bbb
147./array.tests: line 282: syntax error near unexpected token `<>'
148./array.tests: line 282: `metas=( <> < > ! )'
149./array.tests: line 283: syntax error near unexpected token `<>'
150./array.tests: line 283: `metas=( [1]=<> [2]=< [3]=> [4]=! )'
151abc 3
152case 4
153abc case if then else 5
154abc case if then else 5
1550
156case 4
157case if then else 5
158case if then else 5
159argv[1] = <0>
160argv[2] = <1>
161argv[3] = <4>
162argv[4] = <10>
163argv[1] = <0>
164argv[2] = <1>
165argv[3] = <4>
166argv[4] = <10>
167argv[1] = <0>
168argv[2] = <1>
169argv[3] = <4>
170argv[4] = <10>
171argv[1] = <0 1 4 10>
172include null element -- expect one
173one
174include unset element -- expect three five
175three five
176start at unset element -- expect five seven
177five seven
178too many elements -- expect three five seven
179three five seven
180positive offset - expect five seven
181five seven
182negative offset to unset element - expect seven
183seven
184positive offset 2 - expect seven
185seven
186negative offset 2 - expect seven
187seven
188out-of-range offset
189
190e
1914
1921 4 7 10
193'b
194b c
195$0
196t
197[3]=abcde r s t u v
198e
1999
Note: See TracBrowser for help on using the repository browser.