commands.sh

trap

alllinux

Execute a command upon an event.

More info →

Examples (3)

List the commands and the names of the expected events

Execute a command when a signal is received

trap 'echo "Caught signal SIGHUP"' HUP

Remove commands

trap - HUP INT
made by @shridhargupta | data from tldr-pages