Chapter 12. Traps
Rather than waiting to hear through the grapevine about your teenager's latest hi-jinks and then ranting and raving long after the fact, wouldn't it be wonderful if every untoward action generated an “admonishment from parent,” which echoed in his head as if it were between two stereo speakers and you controlled the volume and content? Or how about a mechanism where every time he leaves the house there is an automatic litany of do's and dont's that bray into his mind? If either of these mechanisms sounds enticing, you will find the Korn Shell's capability to trap events to be of interest.
Consider two of the most common events that occur during the execution of a script: errors and exits. The errors referred to here are not ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access