Compare commits
2 Commits
f286c141b3
...
b9b8599169
Author | SHA1 | Date | |
---|---|---|---|
b9b8599169 | |||
8fef80ddad |
6
bash.sh
Executable file
6
bash.sh
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
kill_child_jobs() {
|
||||||
|
# From https://stackoverflow.com/a/360275
|
||||||
|
while kill %% 2>/dev/null; do sleep 0; done
|
||||||
|
}
|
|
@ -9,6 +9,7 @@ echo " ∞=script does not halt (after 1 second timeout)"
|
||||||
echo " X=disown unsupported by shell"
|
echo " X=disown unsupported by shell"
|
||||||
echo " ☠=all children killed"
|
echo " ☠=all children killed"
|
||||||
echo " 🏃=all children still running"
|
echo " 🏃=all children still running"
|
||||||
|
echo " ✔️=expected result (job killed, disowned child alive)"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
printf '\t'
|
printf '\t'
|
||||||
|
|
|
@ -49,23 +49,23 @@ sleep 0.1s
|
||||||
|
|
||||||
if grep -q '^shell does not support disown$' "$TMP"
|
if grep -q '^shell does not support disown$' "$TMP"
|
||||||
then
|
then
|
||||||
printf "X"
|
printf 'X'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! grep -q '^disowned outlived parent.$' "$TMP"
|
if ! grep -q '^disowned outlived parent.$' "$TMP"
|
||||||
then
|
then
|
||||||
# disowned should have outlived parent
|
# disowned should have outlived parent
|
||||||
EXITCODE=2
|
EXITCODE=2
|
||||||
printf "☠"
|
printf '☠'
|
||||||
elif grep -q '^job outlived parent.$' "$TMP"
|
elif grep -q '^job outlived parent.$' "$TMP"
|
||||||
then
|
then
|
||||||
# job should not outlive parent
|
# job should not outlive parent
|
||||||
EXITCODE=3
|
EXITCODE=3
|
||||||
printf "🏃"
|
printf '🏃'
|
||||||
else
|
else
|
||||||
# all good
|
# all good
|
||||||
EXITCODE=0
|
EXITCODE=0
|
||||||
printf '%s' "$SHELL"
|
printf '✔️'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f "$TMP"
|
rm -f "$TMP"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user