commit bash-20200316 snapshot

This commit is contained in:
Chet Ramey
2020-03-20 09:26:56 -04:00
parent 9e6c30de85
commit cf58e12ce6
22 changed files with 214 additions and 90 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
BUILD_DIR=/usr/local/build/chet/bash/bash-current
BUILD_DIR=/usr/local/build/bash/bash-current
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR
+13
View File
@@ -0,0 +1,13 @@
BUILD_DIR=/usr/local/build/bash/bash-current
THIS_SH="$BUILD_DIR/bash -x"
PATH=$PATH:$BUILD_DIR
export THIS_SH PATH BUILD_DIR
: ${TMPDIR:=/tmp}
export TMPDIR
export BASH_TSTOUT=/tmp/xx
rm -f ${BASH_TSTOUT}
/bin/sh -x "$@"
+18 -16
View File
@@ -40,33 +40,35 @@ async list wait-for-background-pids
async list wait for child
forked
wait-when-no-children
posix jobs output
[1]+ Done sleep 1
wait-for-job
./jobs.tests: line 79: wait: %2: no such job
./jobs.tests: line 82: wait: %2: no such job
127
async list wait-for-job
forked
fg-bg 1
sleep 5
sleep 2
fg-bg 2
sleep 5
sleep 2
fg-bg 3
sleep 5
sleep 2
fg-bg 4
sleep 5
sleep 2
fg-bg 5
./jobs.tests: line 106: fg: %2: no such job
./jobs.tests: line 107: bg: job 1 already in background
./jobs.tests: line 109: fg: %2: no such job
./jobs.tests: line 110: bg: job 1 already in background
fg-bg 6
./jobs.tests: line 114: fg: -s: invalid option
./jobs.tests: line 117: fg: -s: invalid option
fg: usage: fg [job_spec]
./jobs.tests: line 115: bg: -s: invalid option
./jobs.tests: line 118: bg: -s: invalid option
bg: usage: bg [job_spec ...]
./jobs.tests: line 120: disown: -s: invalid option
./jobs.tests: line 123: disown: -s: invalid option
disown: usage: disown [-h] [-ar] [jobspec ... | pid ...]
./jobs.tests: line 124: disown: %1: no such job
./jobs.tests: line 127: disown: %2: no such job
./jobs.tests: line 127: disown: %1: no such job
./jobs.tests: line 130: disown: %2: no such job
wait-for-non-child
./jobs.tests: line 130: wait: pid 1 is not a child of this shell
./jobs.tests: line 133: wait: pid 1 is not a child of this shell
127
3 -- 1 2 3 -- 1 - 2 - 3
[1] Running sleep 300 &
@@ -76,8 +78,8 @@ running jobs:
[1] Running sleep 300 &
[2]- Running sleep 350 &
[3]+ Running sleep 400 &
./jobs.tests: line 147: kill: %4: no such job
./jobs.tests: line 149: jobs: %4: no such job
./jobs.tests: line 150: kill: %4: no such job
./jobs.tests: line 152: jobs: %4: no such job
current job:
[3]+ Running sleep 400 &
previous job:
@@ -105,5 +107,5 @@ after kill -STOP, backgrounding %3:
killing...
done
after KILL -STOP, foregrounding %1
sleep 10
sleep 4
done
+20 -17
View File
@@ -49,7 +49,7 @@ wait # make sure we reap the processes while stderr is still redirected
exec 2>&5
echo wait-for-pid
sleep 10 &
sleep 4 &
wait $!
echo wait-errors
@@ -57,52 +57,55 @@ wait 1-1
wait -- -4
echo wait-for-background-pids
sleep 5 &
sleep 8 &
sleep 2 &
sleep 4 &
wait
echo async list wait-for-background-pids
sleep 5 & sleep 8 &
sleep 2 & sleep 4 &
wait
echo async list wait for child
sleep 5 & echo forked
sleep 2 & echo forked
wait
echo wait-when-no-children
wait
echo posix jobs output
${THIS_SH} -o posix -c 'sleep 1 & P=$! ; sleep 2; jobs; wait'
set -m
echo wait-for-job
sleep 5 &
sleep 3 &
wait %2 # this should be a no-such-job error
echo $?
wait %1
echo async list wait-for-job
sleep 5 & echo forked
sleep 2 & echo forked
wait %1
echo fg-bg 1
sleep 5 &
sleep 2 &
%1
echo fg-bg 2
sleep 5 &
sleep 2 &
fg %%
echo fg-bg 3
sleep 5 &
sleep 2 &
fg %s
echo fg-bg 4
sleep 5 &
sleep 2 &
fg %?ee
# these next two are error cases
echo fg-bg 5
sleep 15 &
sleep 2 &
fg %2 # this should be a no-such-job error
bg %1 # this should be a `bg background job?' error
wait
@@ -110,7 +113,7 @@ wait
# these may someday mean to start the jobs, but not print the line
# describing the status, but for now they are errors
echo fg-bg 6
sleep 5 &
sleep 2 &
fg -s %1
bg -s %1
wait
@@ -153,7 +156,7 @@ echo previous job:
jobs %-
kill -STOP %2
sleep 5 # give time for the shell to get the stop notification
sleep 3 # give time for the shell to get the stop notification
echo after kill -STOP
echo running jobs:
jobs -r
@@ -177,7 +180,7 @@ echo stopped jobs:
jobs -s
kill -STOP %3
sleep 5 # give time for the shell to get the stop notification
sleep 3 # give time for the shell to get the stop notification
echo after kill -STOP, backgrounding %3:
bg %3
@@ -195,9 +198,9 @@ echo done
exec 2>&5
sleep 10 &
sleep 4 &
kill -STOP %1
sleep 5 # give time for the shell to get the stop notification
sleep 2 # give time for the shell to get the stop notification
echo after KILL -STOP, foregrounding %1
fg %1
+2
View File
@@ -294,3 +294,5 @@ xtrace off
--
./shopt.tests: line 106: shopt: xyz1: invalid shell option name
./shopt.tests: line 107: shopt: xyz1: invalid option name
expand_aliases on
expand_aliases on
+4
View File
@@ -107,3 +107,7 @@ shopt -p xyz1
shopt -o -p xyz1
${THIS_SH} ./shopt1.sub
# test whether or not temporary variable assignments that manipulate posix
# mode restore the previous state or the default non-posix state
${THIS_SH} -c 'shopt -s expand_aliases ; shopt expand_aliases ; POSIXLY_CORRECT=y true ; shopt expand_aliases'