summaryrefslogtreecommitdiffstats
path: root/tests/builtins.right
blob: 832472f66f4dec0022888a24cfaf160f359cebdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
a
end-1
a
end-2
a:x
end-a
b:x
end-b
c:x
end-c
end-3
a:x
end
a
b
c
end-1
a
b
c
end-2
a:x
a:y
a:z
end-a
b:x
b:y
b:z
end-b
c:x
c:y
c:z
end-c
end-3
a:x
b:x
c:x
end
$BVAR
$BVAR
$BVAR
$BVAR
foo
bar
xxx
0022
u=rwx,g=rx,o=rx
0002
u=rwx,g=rwx,o=rx
umask 0002
umask -S u=rwx,g=rwx,o=rx
u=rwx,g=rwx,o=rwx
enable .
enable :
enable break
enable continue
enable eval
enable exec
enable exit
enable export
enable readonly
enable return
enable set
enable shift
enable source
enable times
enable trap
enable unset
enable .
enable :
enable break
enable continue
enable eval
enable exec
enable exit
enable export
enable readonly
enable return
enable set
enable shift
enable source
enable times
enable trap
enable unset
enable -n test worked
enable test worked
specialname
-specialname
FOO=BAR
FOO=BAR
hash: hash table empty
0
AVAR
foo
in source.sub2, calling return
5
a b c
a b c
x y z
a b c
a b c
m n o p
a b c
m n o p
/tmp/bash-dir-a
/tmp/bash-dir-a
/tmp/bash-dir-a
./source5.sub: line 23: /tmp/source-notthere: No such file or directory
after bad source 1
./source5.sub: line 30: /tmp/source-notthere: No such file or directory
one - OK
0
0
two - OK
0
three - OK
0
four - OK
0
abc
def
ghi
after
one.1 subshell
two.1 subshell
three.1 subshell
four.1 subshell
one.2 subshell
two.2 subshell
three.2 subshell
four.2 subshell
x29 - done
abc
def
ghi
ok
AVAR
foo
foo
AVAR
foo
foo
AVAR
foo
declare -x foo=""
declare -x FOO="\$\$"
./builtins.tests: line 226: declare: FOO: not found
declare -x FOO="\$\$"
ok
ok
./builtins.tests: line 258: kill: 4096: invalid signal specification
1
a\n\n\nb
a


b
before: f = 4
inside
after: f = 8 bar = 4
declare -a c
declare -A d
declare -a c=([0]="4")
declare -A c=([0]="4" )
declare -a c=([0]="1" [1]="2" [2]="3")
declare -A c=([two]="2" [three]="3" [one]="1" )
declare -a c=([0]="1" [1]="2" [2]="3")
declare -a c=([0]="1" [1]="2" [2]="3")
unset
unset
assoc 1 unset
array 1 unset
assoc 2 unset
array 2 unset
unset1
unset2
1
1
1
1
assoc A
array a
assoc B unset
array b unset
scalar 1
scalar 2
scalar 3 unset
argv[1] = <one two three>
assoc: 3
array: 3
scalar: 13
scalar: 1
scalar: 0
scalar: 1
scalar: 0
scalar: 0
all set:
one
two
f1 () 
{ 
    echo f1
}
f2 () 
{ 
    echo f2
}
all unset:
unset1
unset2
./builtins6.sub: line 41: declare: f1: not found
./builtins6.sub: line 41: declare: f2: not found
all reset:
one-one
two-one
f1 () 
{ 
    echo f1
}
f2 () 
{ 
    echo f2
}
vars unset:
unset1
unset2
f1 () 
{ 
    echo f1
}
f2 () 
{ 
    echo f2
}
funcs unset:
one-two
two-two
bash: line 1: notthere: No such file or directory
one
bash: line 1: notthere: No such file or directory
two
bash: line 1: .: notthere: file not found
one
bash: line 1: .: notthere: file not found
0
0
0
0
argv[1] = <one>
0
argv[1] = <two>
0
three
0
four
0
./builtins7.sub: line 19: : command not found
127
0
./builtins7.sub: line 27: notthere: No such file or directory
after 1
./builtins7.sub: line 28: notthere: No such file or directory
after 2
type is a shell builtin
+ command -v type
type
+ command command -v type
type
+ command -p command -v type
type
+ command -p -- command -v type
type
+ set +x
./builtins.tests: line 282: exit: status: numeric argument required