mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-02 20:54:57 +00:00
Update cheatsheets
This commit is contained in:
21
trap
Normal file
21
trap
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# trap
|
||||
|
||||
> Execute a command upon an event.
|
||||
> More information: <https://manned.org/trap.1posix>.
|
||||
|
||||
- List the commands and the names of the expected events:
|
||||
|
||||
`trap`
|
||||
|
||||
- Execute a command when a signal is received:
|
||||
|
||||
`trap 'echo "Caught signal {{SIGHUP}}"' {{HUP}}`
|
||||
|
||||
- Remove commands:
|
||||
|
||||
`trap - {{HUP}} {{INT}}`
|
||||
Reference in New Issue
Block a user