|
From: | Pierre Gaston |
Subject: | Re: [Help-bash] How to trap SIGTERM? |
Date: | Sat, 20 Apr 2013 08:17:21 +0300 |
Hi,
~/linux/test/bash/man/builtin/trap/SIGTERM$ cat main.sh
#!/usr/bin/env bash
echo $$
trap "echo Booh!; exit" SIGTERM
while true
do
sleep 60
done
I have the above script. I run it and get the process id. Then I use
"kill -SIGTERM pid" to kill it. But the script fails to respond. Does
anybody know how to get the script respond to SIGTERM? Thanks.
--
Regards,
Peng
[Prev in Thread] | Current Thread | [Next in Thread] |