Is it possible to enforce a certain exit code when using "kill" to stop a process?
feedback
|
|
This will exit with a 42 if any of the listed signals are received. You could perform other actions including calling a function, etc.
| |||||||
feedback
|
|
Yes, you have the trap the kill signals you send to your script using the trap command, see man bash and look for the trap command. After "trapping" the signal sent to the script, you could exit with any value you want to. | |||
|
feedback
|