May 2000
Beginner
761 pages
18h 20m
English
If a script is interrupted with the Interrupt key, it terminates and control is returned to the TC shell, that is, you get your prompt back. The onintr command is used to process interrupts within a script. It allows you to ignore the interrupt (^C) or transfer control to another part of the program before exiting. Normally, the interrupt command is used with a label to "clean up" before exiting. The onintr command without arguments restores the default action.
(The Script) 1 onintr finish 2 < Script continues here > 3 finish: 4 onintr - # Disable further interrupts 5 echo Cleaning temp files 6 rm $$tmp* ; exit 1 |
Explanation
The onintr command is followed by a label name. The label finish is a user-defined ...
Read now
Unlock full access