update manuscript

This commit is contained in:
Dylan Araps
2018-06-20 16:00:33 +10:00
parent 393a288242
commit d2c42689d8
18 changed files with 43 additions and 52 deletions

View File

@@ -1,8 +1,8 @@
# Traps
# TRAPS
Traps allow you to execute code on various signals. In `pxltrm` I'm using traps to redraw the user interface on window resize. Another use case is cleaning up temporary files on script exit.
Traps allow a script to execute code on various signals. In [pxltrm](https://github.com/dylanaraps/pxltrm) (*a pixel art editor written in bash*) traps are used to redraw the user interface on window resize. Another use case is cleaning up temporary files on script exit.
These `trap` lines should be added near the start of your script so any early errors are also caught.
Traps should be added near the start of scripts so any early errors are also caught.
**NOTE:** For a full list of signals, see `trap -l`.