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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
|
########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1982-2010 AT&T Intellectual Property #
# and is licensed under the #
# Common Public License, Version 1.0 #
# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# http://www.opensource.org/licenses/cpl1.0.txt #
# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
# #
# Information and Software Systems Research #
# AT&T Research #
# Florham Park NJ #
# #
# David Korn <dgk@research.att.com> #
# #
########################################################################
function err_exit
{
print -u2 -n "\t"
print -u2 -r ${Command}[$1]: "${@:2}"
let Errors+=1
}
alias err_exit='err_exit $LINENO'
Command=${0##*/}
integer Errors=0
unset HISTFILE
export LC_ALL=C ENV=
ulimit -c 0
tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
trap "cd /; rm -rf $tmp" EXIT
if [[ $( ${SHELL-ksh} -s hello<<-\!
print $1
!
) != hello ]]
then err_exit "${SHELL-ksh} -s not working"
fi
x=$(
set -e
false && print bad
print good
)
if [[ $x != good ]]
then err_exit 'sh -e not working'
fi
[[ $($SHELL -D -c 'print hi; print $"hello"') == '"hello"' ]] || err_exit 'ksh -D not working'
env=$tmp/.env
print $'(print -u1 aha) &>/dev/null\n(print -u2 aha) &>/dev/null' > $env
rc=$tmp/.kshrc
print $'PS1=""\nfunction env_hit\n{\n\tprint OK\n}' > $rc
export ENV=/.$env
if [[ ! -o privileged ]]
then
got=$($SHELL -E -c : 2>/dev/null)
if [[ $g ]]
then
got=$(printf %q "$got")
err_exit "\$ENV file &>/dev/null does not redirect stdout -- expected '', got $got"
fi
got=$($SHELL -E -c : 2>&1 >/dev/null)
if [[ $got != *nonstandard* || $got == *$'\n'* ]]
then
got=$(printf %q "$got")
err_exit "\$ENV file &>/dev/null does not redirect stderr -- expected one diagnostic line, got $got"
fi
fi
export ENV=/.$rc
if [[ -o privileged ]]
then
[[ $(print env_hit | $SHELL 2>&1) == "OK" ]] &&
err_exit 'privileged nointeractive shell reads $ENV file'
[[ $(print env_hit | $SHELL -E 2>&1) == "OK" ]] &&
err_exit 'privileged -E reads $ENV file'
[[ $(print env_hit | $SHELL +E 2>&1) == "OK" ]] &&
err_exit 'privileged +E reads $ENV file'
[[ $(print env_hit | $SHELL --rc 2>&1) == "OK" ]] &&
err_exit 'privileged --rc reads $ENV file'
[[ $(print env_hit | $SHELL --norc 2>&1) == "OK" ]] &&
err_exit 'privileged --norc reads $ENV file'
else
[[ $(print env_hit | $SHELL 2>&1) == "OK" ]] &&
err_exit 'nointeractive shell reads $ENV file'
[[ $(print env_hit | $SHELL -E 2>&1) == "OK" ]] ||
err_exit '-E ignores $ENV file'
[[ $(print env_hit | $SHELL +E 2>&1) == "OK" ]] &&
err_exit '+E reads $ENV file'
[[ $(print env_hit | $SHELL --rc 2>&1) == "OK" ]] ||
err_exit '--rc ignores $ENV file'
[[ $(print env_hit | $SHELL --norc 2>&1) == "OK" ]] &&
err_exit '--norc reads $ENV file'
[[ $(print env_hit | $SHELL -i 2>&1) == "OK" ]] ||
err_exit '-i ignores $ENV file'
fi
export ENV=
if [[ -o privileged ]]
then
[[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
err_exit 'privileged nointeractive shell reads $HOME/.kshrc file'
[[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] &&
err_exit 'privileged -E ignores empty $ENV'
[[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] &&
err_exit 'privileged +E reads $HOME/.kshrc file'
[[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] &&
err_exit 'privileged --rc ignores empty $ENV'
[[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
err_exit 'privileged --norc reads $HOME/.kshrc file'
else
[[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
err_exit 'nointeractive shell reads $HOME/.kshrc file'
[[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] &&
err_exit '-E ignores empty $ENV'
[[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] &&
err_exit '+E reads $HOME/.kshrc file'
[[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] &&
err_exit '--rc ignores empty $ENV'
[[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
err_exit '--norc reads $HOME/.kshrc file'
fi
unset ENV
if [[ -o privileged ]]
then
[[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
err_exit 'privileged nointeractive shell reads $HOME/.kshrc file'
[[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] &&
err_exit 'privileged -E reads $HOME/.kshrc file'
[[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] &&
err_exit 'privileged +E reads $HOME/.kshrc file'
[[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] &&
err_exit 'privileged --rc reads $HOME/.kshrc file'
[[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
err_exit 'privileged --norc reads $HOME/.kshrc file'
else
[[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
err_exit 'nointeractive shell reads $HOME/.kshrc file'
[[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] ||
err_exit '-E ignores $HOME/.kshrc file'
[[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] &&
err_exit '+E reads $HOME/.kshrc file'
[[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] ||
err_exit '--rc ignores $HOME/.kshrc file'
[[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
err_exit '--norc reads $HOME/.kshrc file'
fi
rm -rf $tmp/.kshrc
if command set -G 2> /dev/null
then cd $tmp
mkdir bar foo
> bar.c > bam.c
> bar/foo.c > bar/bam.c
> foo/bam.c
set -- **.c
expected='bam.c bar.c'
[[ $* == $expected ]] ||
err_exit "-G **.c failed -- expected '$expected', got '$*'"
set -- **
expected='bam.c bar bar.c bar/bam.c bar/foo.c foo foo/bam.c'
[[ $* == $expected ]] ||
err_exit "-G ** failed -- expected '$expected', got '$*'"
set -- **/*.c
expected='bam.c bar.c bar/bam.c bar/foo.c foo/bam.c'
[[ $* == $expected ]] ||
err_exit "-G **/*.c failed -- expected '$expected', got '$*'"
set -- **/bam.c
expected='bam.c bar/bam.c foo/bam.c'
[[ $* == $expected ]] ||
err_exit "-G **/bam.c failed -- expected '$expected', got '$*'"
cd ~-
fi
cd $tmp
t="<$$>.profile.<$$>"
echo "echo '$t'" > .profile
cp $SHELL ./-ksh
if [[ -o privileged ]]
then
[[ $(HOME=$PWD $SHELL -l </dev/null 2>&1) == *$t* ]] &&
err_exit 'privileged -l reads .profile'
[[ $(HOME=$PWD $SHELL --login </dev/null 2>&1) == *$t* ]] &&
err_exit 'privileged --login reads .profile'
[[ $(HOME=$PWD $SHELL --login-shell </dev/null 2>&1) == *$t* ]] &&
err_exit 'privileged --login-shell reads .profile'
[[ $(HOME=$PWD $SHELL --login_shell </dev/null 2>&1) == *$t* ]] &&
err_exit 'privileged --login_shell reads .profile'
[[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>&1) == *$t* ]] &&
err_exit 'privileged exec -a -ksh ksh reads .profile'
[[ $(HOME=$PWD ./-ksh -i </dev/null 2>&1) == *$t* ]] &&
err_exit 'privileged ./-ksh reads .profile'
[[ $(HOME=$PWD ./-ksh -ip </dev/null 2>&1) == *$t* ]] &&
err_exit 'privileged ./-ksh -p reads .profile'
else
[[ $(HOME=$PWD $SHELL -l </dev/null 2>&1) == *$t* ]] ||
err_exit '-l ignores .profile'
[[ $(HOME=$PWD $SHELL --login </dev/null 2>&1) == *$t* ]] ||
err_exit '--login ignores .profile'
[[ $(HOME=$PWD $SHELL --login-shell </dev/null 2>&1) == *$t* ]] ||
err_exit '--login-shell ignores .profile'
[[ $(HOME=$PWD $SHELL --login_shell </dev/null 2>&1) == *$t* ]] ||
err_exit '--login_shell ignores .profile'
[[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>/dev/null) == *$t* ]] ||
err_exit 'exec -a -ksh ksh 2>/dev/null ignores .profile'
[[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>&1) == *$t* ]] ||
err_exit 'exec -a -ksh ksh 2>&1 ignores .profile'
[[ $(HOME=$PWD ./-ksh -i </dev/null 2>&1) == *$t* ]] ||
err_exit './-ksh ignores .profile'
[[ $(HOME=$PWD ./-ksh -ip </dev/null 2>&1) == *$t* ]] &&
err_exit './-ksh -p does not ignore .profile'
fi
cd ~-
rm -rf $tmp/.profile
# { exec interactive login_shell restricted xtrace } in the following test
for opt in \
allexport all-export all_export \
bgnice bg-nice bg_nice \
clobber emacs \
errexit err-exit err_exit \
glob \
globstar glob-star glob_star \
gmacs \
ignoreeof ignore-eof ignore_eof \
keyword log markdirs monitor notify \
pipefail pipe-fail pipe_fail \
trackall track-all track_all \
unset verbose vi \
viraw vi-raw vi_raw
do old=$opt
if [[ ! -o $opt ]]
then old=no$opt
fi
set --$opt || err_exit "set --$opt failed"
[[ -o $opt ]] || err_exit "[[ -o $opt ]] failed"
[[ -o no$opt ]] && err_exit "[[ -o no$opt ]] failed"
[[ -o no-$opt ]] && err_exit "[[ -o no-$opt ]] failed"
[[ -o no_$opt ]] && err_exit "[[ -o no_$opt ]] failed"
[[ -o ?$opt ]] || err_exit "[[ -o ?$opt ]] failed"
[[ -o ?no$opt ]] || err_exit "[[ -o ?no$opt ]] failed"
[[ -o ?no-$opt ]] || err_exit "[[ -o ?no-$opt ]] failed"
[[ -o ?no_$opt ]] || err_exit "[[ -o ?no_$opt ]] failed"
set --no$opt || err_exit "set --no$opt failed"
[[ -o no$opt ]] || err_exit "[[ -o no$opt ]] failed"
[[ -o $opt ]] && err_exit "[[ -o $opt ]] failed"
set --no-$opt || err_exit "set --no-$opt failed"
[[ -o no$opt ]] || err_exit "[[ -o no$opt ]] failed"
[[ -o $opt ]] && err_exit "[[ -o $opt ]] failed"
set --no_$opt || err_exit "set --no_$opt failed"
[[ -o no$opt ]] || err_exit "[[ -o no$opt ]] failed"
[[ -o $opt ]] && err_exit "[[ -o $opt ]] failed"
set -o $opt || err_exit "set -o $opt failed"
[[ -o $opt ]] || err_exit "[[ -o $opt ]] failed"
set -o $opt=1 || err_exit "set -o $opt=1 failed"
[[ -o $opt ]] || err_exit "[[ -o $opt ]] failed"
set -o no$opt=0 || err_exit "set -o no$opt=0 failed"
[[ -o $opt ]] || err_exit "[[ -o $opt ]] failed"
set --$opt=1 || err_exit "set --$opt=1 failed"
[[ -o $opt ]] || err_exit "[[ -o $opt ]] failed"
set --no$opt=0 || err_exit "set --no$opt=0 failed"
[[ -o $opt ]] || err_exit "[[ -o $opt ]] failed"
set -o no$opt || err_exit "set -o no$opt failed"
[[ -o no$opt ]] || err_exit "[[ -o no$opt ]] failed"
set -o $opt=0 || err_exit "set -o $opt=0 failed"
[[ -o no$opt ]] || err_exit "[[ -o no$opt ]] failed"
set -o no$opt=1 || err_exit "set -o no$opt=1 failed"
[[ -o no$opt ]] || err_exit "[[ -o no$opt ]] failed"
set --$opt=0 || err_exit "set --$opt=0 failed"
[[ -o no$opt ]] || err_exit "[[ -o no$opt ]] failed"
set --no$opt=1 || err_exit "set --no$opt=1 failed"
[[ -o no$opt ]] || err_exit "[[ -o no$opt ]] failed"
set -o no-$opt || err_exit "set -o no-$opt failed"
[[ -o no-$opt ]] || err_exit "[[ -o no-$opt ]] failed"
set -o no_$opt || err_exit "set -o no_$opt failed"
[[ -o no_$opt ]] || err_exit "[[ -o no_$opt ]] failed"
set +o $opt || err_exit "set +o $opt failed"
[[ -o no$opt ]] || err_exit "[[ -o no$opt ]] failed"
set +o no$opt || err_exit "set +o no$opt failed"
[[ -o $opt ]] || err_exit "[[ -o $opt ]] failed"
set +o no-$opt || err_exit "set +o no-$opt failed"
[[ -o $opt ]] || err_exit "[[ -o $opt ]] failed"
set +o no_$opt || err_exit "set +o no_$opt failed"
[[ -o $opt ]] || err_exit "[[ -o $opt ]] failed"
set --$old
done
for opt in \
exec interactive login_shell login-shell logi privileged \
rc restricted xtrace
do [[ -o $opt ]]
y=$?
[[ -o no$opt ]]
n=$?
case $y$n in
10|01) ;;
*) err_exit "[[ -o $opt ]] == [[ -o no$opt ]]" ;;
esac
done
for opt in \
foo foo-bar foo_bar
do if [[ -o ?$opt ]]
then err_exit "[[ -o ?$opt ]] should fail"
fi
if [[ -o ?no$opt ]]
then err_exit "[[ -o ?no$opt ]] should fail"
fi
done
[[ $(set +o) == $(set --state) ]] || err_exit "set --state different from set +o"
set -- $(set --state)
[[ $1 == set && $2 == --default ]] || err_exit "set --state failed -- expected 'set --default *', got '$1 $2 *'"
shift
restore=$*
shift
off=
for opt
do case $opt in
--not*) opt=${opt/--/--no} ;;
--no*) opt=${opt/--no/--} ;;
--*) opt=${opt/--/--no} ;;
esac
off="$off $opt"
done
set $off
state=$(set --state)
default=$(set --default --state)
[[ $state == $default ]] || err_exit "set --state for default options failed: expected '$default', got '$state'"
set $restore
state=$(set --state)
[[ $state == "set $restore" ]] || err_exit "set --state after restore failed: expected 'set $restore', got '$state'"
typeset -a pipeline
pipeline=(
( nopipefail=0 pipefail=1 command='false|true|true' )
( nopipefail=0 pipefail=1 command='true|false|true' )
( nopipefail=1 pipefail=1 command='true|true|false' )
( nopipefail=1 pipefail=1 command='false|false|false' )
( nopipefail=0 pipefail=0 command='true|true|true' )
( nopipefail=0 pipefail=0 command='print hi|(sleep 1;/bin/cat)>/dev/null' )
)
set --nopipefail
for ((i = 0; i < ${#pipeline[@]}; i++ ))
do eval ${pipeline[i].command}
status=$?
expected=${pipeline[i].nopipefail}
[[ $status == $expected ]] ||
err_exit "--nopipefail '${pipeline[i].command}' exit status $status -- expected $expected"
done
ftt=0
set --pipefail
for ((i = 0; i < ${#pipeline[@]}; i++ ))
do eval ${pipeline[i].command}
status=$?
expected=${pipeline[i].pipefail}
if [[ $status != $expected ]]
then err_exit "--pipefail '${pipeline[i].command}' exit status $status -- expected $expected"
(( i == 0 )) && ftt=1
fi
done
if (( ! ftt ))
then exp=10
got=$(for((n=1;n<exp;n++))do $SHELL --pipefail -c '(sleep 0.1;false)|true|true' && break; done; print $n)
[[ $got == $exp ]] || err_exit "--pipefail -c '(sleep 0.1;false)|true|true' fails with exit status 0 (after $got/$exp iterations)"
fi
echo=$(whence -p echo)
for ((i=0; i < 20; i++))
do if ! x=$(true | $echo 123)
then err_exit 'command substitution with wrong exit status with pipefai'
break
fi
done
(
set -o pipefail
false | true
(( $? )) || err_exit 'pipe not failing in subshell with pipefail'
) | wc >/dev/null
$SHELL -c 'set -o pipefail; false | $(whence -p true);' && err_exit 'pipefail not returning failure with sh -c'
exp='1212 or 1221'
got=$(
set --pipefail
pipe() { date | cat > /dev/null ;}
print $'1\n2' |
while read i
do if pipe $tmp
then { print -n $i; sleep 2; print -n $i; } &
fi
done
wait
)
[[ $got == @((12|21)(12|21)) ]] || err_exit "& job delayed by --pipefail, expected '$exp', got '$got'"
$SHELL -c '[[ $- == *c* ]]' || err_exit 'option c not in $-'
> $tmp/.profile
for i in i l r s D E a b e f h k n t u v x B C G H
do HOME=$tmp ENV= $SHELL -$i >/dev/null 2>&1 <<- ++EOF++ || err_exit "option $i not in \$-"
[[ \$- == *$i* ]] || exit 1
++EOF++
done
letters=ilrabefhknuvxBCGE
integer j=0
for i in interactive login restricted allexport notify errexit \
noglob trackall keyword noexec nounset verbose xtrace braceexpand \
noclobber globstar rc
do HOME=$tmp ENV= $SHELL -o $i >/dev/null 2>&1 <<- ++EOF++ || err_exit "option $i not equivalent to ${letters:j:1}"
[[ \$- == *${letters:j:1}* ]] || exit 1
++EOF++
((j++))
done
export ENV=
histfile=$tmp/history
exp=$(HISTFILE=$histfile $SHELL -c $'function foo\n{\ncat\n}\ntype foo')
for var in HISTSIZE HISTFILE
do got=$( ( HISTFILE=$histfile $SHELL -ic $'unset '$var$'\nfunction foo\n{\ncat\n}\ntype foo\nexit' ) 2>&1 )
got=${got##*': '}
[[ $got == "$exp" ]] || err_exit "function definition inside (...) with $var unset fails -- got '$got', expected '$exp'"
got=$( { HISTFILE=$histfile $SHELL -ic $'unset '$var$'\nfunction foo\n{\ncat\n}\ntype foo\nexit' ;} 2>&1 )
got=${got##*': '}
[[ $got == "$exp" ]] || err_exit "function definition inside {...;} with $var unset fails -- got '$got', expected '$exp'"
done
( unset HISTFILE; $SHELL -ic "HISTFILE=$histfile" 2>/dev/null ) || err_exit "setting HISTFILE when not in environment fails"
# the next tests loop on all combinations of
# { SUB PAR CMD ADD }
SUB=(
( BEG='$( ' END=' )' )
( BEG='${ ' END='; }' )
)
PAR=(
( BEG='( ' END=' )' )
( BEG='{ ' END='; }' )
)
CMD=( command-kill script-kill )
ADD=( '' '; :' )
cd $tmp
print $'#!'$SHELL$'\nkill -KILL $$' > command-kill
print $'kill -KILL $$' > script-kill
chmod +x command-kill script-kill
export PATH=.:$PATH
exp='Killed'
for ((S=0; S<${#SUB[@]}; S++))
do for ((P=0; P<${#PAR[@]}; P++))
do for ((C=0; C<${#CMD[@]}; C++))
do for ((A=0; A<${#ADD[@]}; A++))
do cmd="${SUB[S].BEG}${PAR[P].BEG}${CMD[C]}${PAR[P].END} 2>&1${ADD[A]}${SUB[S].END}"
eval got="$cmd"
got=${got##*': '}
got=${got%%'('*}
[[ $got == "$exp" ]] || err_exit "$cmd failed -- got '$got', expected '$exp'"
done
done
done
done
$SHELL 2> /dev/null -c '{; true ;}' || err_exit 'leading ; causes syntax error in brace group'
$SHELL 2> /dev/null -c '(; true ;)' || err_exit 'leading ; causes syntax error in parenthesis group'
print 'for ((i = 0; i < ${1:-10000}; i++ )); do printf "%.*c\n" 15 x; done' > pipefail
chmod +x pipefail
$SHELL --pipefail -c './pipefail 10000 | sed 1q' >/dev/null 2>&1 &
tst=$!
{ sleep 4; kill $tst; } 2>/dev/null &
spy=$!
wait $tst 2>/dev/null
status=$?
if [[ $status == 0 || $(kill -l $status) == PIPE ]]
then kill $spy 2>/dev/null
else err_exit "pipefail pipeline bypasses SIGPIPE and hangs"
fi
wait
exit $((Errors))
|