trap
Defines and activates handlers to be run when the shell receives signals or other conditions.[1]
Documentation
- trap [EN] @ GNU Bash Reference Manual
- bash -c 'help trap'
- man 1 'bash' [EN]
Syntax
trap [PARAMETER ...] [[COMMAND] SIGNAL ...]
Parameters
- -l
- Print a list of signal names and their corresponding numbers.
- -p
- Display the trap COMMANDs associated with each SIGNAL.
References
- ↑ bash -c 'help trap'