trap

Execute a command upon an event. More information: https://www.gnu.org/software/bash/manual/bash.html#index-trap.

trap -l

trap

trap 'echo "Caught signal {{SIGHUP}}"' {{SIGHUP}}

trap - {{SIGHUP}} {{SIGINT}}

trap '' {{SIGINT}}