Execute commands if any signals are received. Common signals include EXIT (0), HUP (1), INT (2), and TERM (15). Multiple commands must be quoted as a group and separated by semi-colons internally. If the command is the null string (i.e., trap “” signals), the signals are ignored by the shell. If the commands are omitted entirely, processing of the specified signals is reset to the default action. If the command is -, the signals are reset to their initial defaults.
If both commands and signals are omitted, list current trap assignments. See the Examples here and in exec.
List all signals and their numbers, like kill -l.
Print the current trap settings in a form suitable for rereading later.
A list of signal names, numbers, and meanings were given earlier in the kill entry; see the listing there. The shell allows you to use either the signal number or the signal name (without the SIG prefix). In addition, the shell supports “pseudo-signals,” signal names or numbers that aren’t real operating system signals but which direct the shell to perform a specific action. These signals are:
Execution of any command.
Nonzero exit status.
Exit from shell (usually when shell script finishes).
Same as EXIT, for historical compatibility with the Bourne shell.
A return is executed, or a script run with . (dot) or source finishes.
trap "" INTIgnore interrupts (signal 2)
trap INTObey interrupts again
Remove a ...