| Start | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Introduction: clean up temporary files You can use the One of the most common uses of Unfortunately not enough shell scripts do this ???? |
|||||||||||||||||||||||||||||||||
| Catching SIGINT or Ctl+C The trap is reset for subshells, so the And a variant which still allows you to quit the main program by pressing |
|||||||||||||||||||||||||||||||||
| Accumulate a list of trap work to run at exit. Have you ever forgotten to add a Have you ever set one trap which canceled another? This code makes it easy to add things to be done on exit one item at a time, rather than having one large |
|||||||||||||||||||||||||||||||||
| Killing Child Processes on Exit Trap expressions don't have to be individual functions or programs, they can be more complex expressions as well. By combining |
|||||||||||||||||||||||||||||||||
| react on change of terminals window size There is a signal WINCH ( WINdowCHange), which is fired when one resizes a terminal window. Syntax
Parameters
RemarksThe Examples that are POSIX-compatible start with The signals can either be a signal number, a signal name (without the SIG prefix), or the special keyword Those guaranteed by POSIX are:
|
Read Article
https://develop.horje.com/learn/1434/reference