Open
Description
In bash/ash/dash, if you run exec $0
from within a signal handler things work fine and run in an infinite loop as they should:
#!/usr/bin/env osh
trap hup HUP
hup() {
echo "hup handler"
exec $0
}
main() {
{
echo subproc start
sleep 1
kill -HUP 0
} &
echo mainproc
sleep 999
}
main
In osh, this same script just terminates immediately at exec $0
.