]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/array.right
Imported from ../bash-2.04.tar.gz.
[thirdparty/bash.git] / tests / array.right
CommitLineData
bb70624e
JA
1./array.tests: array assign: line 10: syntax error near unexpected token `&'
2./array.tests: array assign: line 10: `first & second'
31
ccc6cda3 4abcde
d166f048 5abcde
ccc6cda3
JA
6abcde bdef
7abcde bdef
8declare -a DIRSTACK='()'
9declare -a a='([0]="abcde" [1]="" [2]="bdef")'
10declare -a b='()'
11declare -ar c='()'
12abcde bdef
13abcde bdef
14abcde
15abcde
16abcde
17
18bdef
19hello world
2011
213
22bdef hello world test expression
23./array.tests: readonly: `a[5]': not a valid identifier
24declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
25declare -ar c='()'
26declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
27declare -ar c='()'
cce855bc
JA
28readonly -a a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
29readonly -a c='()'
ccc6cda3
JA
30./array.tests: declare: e: cannot assign to array variables in this way
31a test
32declare -a DIRSTACK='()'
33declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
34declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
35declare -ar c='()'
36declare -a d='([1]="" [2]="bdef" [5]="hello world" [6]="test" [9]="ninth element")'
37declare -a e='([0]="test")'
38declare -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
50declare -a DIRSTACK='()'
51declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
52declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
53declare -ar c='()'
e8ce775d 54declare -a d='([1]="test test")'
ccc6cda3
JA
55declare -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
58this of
59this is a test of read using arrays
cce855bc
JA
60this test
61this is a test of arrays
ccc6cda3 62declare -a DIRSTACK='()'
ccc6cda3
JA
63declare -ar a='([1]="" [2]="bdef" [5]="hello world" [6]="test expression")'
64declare -a b='([0]="this" [1]="is" [2]="a" [3]="test" [4]="" [5]="/etc/passwd")'
65declare -ar c='()'
e8ce775d 66declare -a d='([1]="test test")'
ccc6cda3 67declare -a f='([0]="" [1]="bdef" [2]="hello world" [3]="test" [4]="ninth element")'
d166f048 68declare -a rv='([0]="this" [1]="is" [2]="a" [3]="test" [4]="of" [5]="read" [6]="using" [7]="arrays")'
ccc6cda3
JA
69abde
70abde
71bbb
72efgh
73wxyz
74wxyz
75./array.tests
76a
77b c
78d
79e f g
80h
81./array.tests
82a
83b c
84d
85e f g
86h
d166f048
JA
87/bin /usr/bin /usr/ucb /usr/local/bin . /sbin /usr/sbin
88bin bin ucb bin . sbin sbin
89bin
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
954 -- 4
967 -- 7
9755
9849
996 -- 6
10042 14 44
101grep [ 123 ] *
1026 7 9
1036 7 9 5
cce855bc
JA
104length = 3
105value = new1 new2 new3
d166f048 106./array.tests: narray: unbound variable
bb70624e
JA
107
108a b c d e f g
109for case if then else
110<> < > !
11112 14 16 18 20
1124414758999202
113./array.tests: array assign: line 257: syntax error near unexpected token `for'
114./array.tests: array assign: line 257: `a b c for case if then else'
115./array.tests: array assign: line 259: syntax error near unexpected token `for'
116./array.tests: array assign: line 259: `for case if then else'
117./array.tests: array assign: line 261: syntax error near unexpected token `<>'
118./array.tests: array assign: line 261: ` <> < > ! '
119./array.tests: array assign: line 262: syntax error near unexpected token `[1]=<>'
120./array.tests: array assign: line 262: ` [1]=<> [2]=< [3]=> [4]=! '