Automatically execute commands after receiving signals by processes or the…
Automatically execute commands after receiving signals by processes or the operating system. Can be used to perform cleanups for interruptions by the user or other actions.
trap -l
trap -p
trap 'echo "Caught signal {{SIGHUP}}"' {{SIGHUP}}
trap - {{SIGHUP}} {{SIGINT}}