[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-bash] Difference between INT and TERM?
From: |
Peng Yu |
Subject: |
[Help-bash] Difference between INT and TERM? |
Date: |
Fri, 29 May 2015 10:22:55 -0500 |
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
- [Help-bash] Difference between INT and TERM?,
Peng Yu <=