Hi,
I have the following scripts.
==> main.sh <==
#!/usr/bin/env bash
set -v
./script.sh &
pid=$!
sleep 1
kill -s INT "$pid"
==> script.sh <==
#!/usr/bin/env bash
trap "echo $0:$$:EXIT" EXIT
sleep 10
exit -1
I will see something like "./script.sh:15449:EXIT" printed to the
screen in 10 sec.
But if I change INT in main.sh to TERM, I will see the message printed
right after kill.
I understand that the default for INT and TERM are both exit. Why they
are different in the above test cases?
--
Regards,
Peng