shell: add testsuite for "wait $pid" waiting for other tasks

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2020-09-29 22:36:36 +02:00
parent 91e11eba6e
commit d4dd48f294
4 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,2 @@
Background1
Ok:0

View File

@ -0,0 +1,7 @@
sleep 1 && echo "Background1" &
pid=$!
sleep 3 && echo "Background2: BUG!" &
# Shouldn't wait for 2nd bkgd:
wait $pid
kill $!
echo Ok:$?

View File

@ -0,0 +1,2 @@
Background1
Ok:0

View File

@ -0,0 +1,7 @@
sleep 1 && echo "Background1" &
pid=$!
sleep 3 && echo "Background2: BUG!" &
# Shouldn't wait for 2nd bkgd:
wait $pid
kill $!
echo Ok:$?