|
| From: | Clark J. Wang |
| Subject: | Bash cannot kill itself? |
| Date: | Wed, 30 Jun 2010 12:31:07 +0800 |
I have a bash script like this:
#!/bin/bash
trap 'echo killed by SIGALRM; exit 1' ALRM
function wait_kill()
{
sleep 5
kill -ALRM $$
}
wait_kill &
sleep 3600
### END OF THE SCRIPT ###
It does not work as I expected. The running script was not terminated after
5 seconds. So what's wrong here?
-Clark
| [Prev in Thread] | Current Thread | [Next in Thread] |