onintr
"On interrupt." Used in shell scripts to handle interrupt signals
(similar to the Bourne shell's
trap 2
and
trap "" 2
commands).
The first form is like a
goto
Example
onintr cleanup # go to "cleanup" on interrupt . . # shell script commands . cleanup: # label for interrupts onintr - # ignore additional interrupts rm -f $tmpfiles # remove any files created exit 2 # exit with an error status |
|