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 " ☠=all children killed"
|
||||
echo " 🏃=all children still running"
|
||||
echo " ✔️=expected result (job killed, disowned child alive)"
|
||||
echo
|
||||
|
||||
printf '\t'
|
||||
|
|
|
@ -49,23 +49,23 @@ sleep 0.1s
|
|||
|
||||
if grep -q '^shell does not support disown$' "$TMP"
|
||||
then
|
||||
printf "X"
|
||||
printf 'X'
|
||||
fi
|
||||
|
||||
if ! grep -q '^disowned outlived parent.$' "$TMP"
|
||||
then
|
||||
# disowned should have outlived parent
|
||||
EXITCODE=2
|
||||
printf "☠"
|
||||
printf '☠'
|
||||
elif grep -q '^job outlived parent.$' "$TMP"
|
||||
then
|
||||
# job should not outlive parent
|
||||
EXITCODE=3
|
||||
printf "🏃"
|
||||
printf '🏃'
|
||||
else
|
||||
# all good
|
||||
EXITCODE=0
|
||||
printf '%s' "$SHELL"
|
||||
printf '✔️'
|
||||
fi
|
||||
|
||||
rm -f "$TMP"
|
||||
|
|
Loading…
Reference in New Issue
Block a user