In bash script I handle different signal as follows:
#!/bin/bash sighdl () { echo \"signal caught\" #do something exit 0 } trap sighdl SIGKILL SIGINT SI
You cannot do that. Yes 9 is SIGKILL and Unix system by design doesn't allow any script/program to trap SIGKILL due to security reasons. Otherwise any script can trap & ignore SIGKILL which will make impossible to terminate that script by OS.
SIGKILL