|
Hello -
I have a bash daemon with the following signal trap code:
trap shutdown_daemon $EXIT_SIGNAL SIGTERM SIGINT SIGHUP
Where:
shutdown_daemon is a function I am calling.
$EXIT_SIGNAL is a var that contains an argument that I want to pass to the function.
SIGTERM SIGINT SIGHUP are the signals I want to trap.
Current Behavior:
The function is called when a signal is trapped, but it does not receive an argument in $1. I'm guessing that trap sees the arg as just another signal number.
How can I pass an argument to a function called via the "trap" built-in? Is there some quoting magic that I am missing?
Thanks,
-js
|