There is question about multiple bash traps for same signal. What about the opposite version? Is possible to write something like this:
sighand () {
case $1 in
1)
echo "CATCH: SIGHUP"
;;
2)
echo "CATCH: SIGINIT"
;;
...
# ALL EXCEPT 9
...
esac
};
trap sighand ALL
instead of this:
sighand () {
echo "CATCH: TERM"
};
trap sighand TERM