Summary

This chapter covered the concept of signals. Signals inform a program that an important event has occurred.

First we examined the most common signals encountered in shell programming. This was followed by a discussion of the methods for obtaining a list of the signals supported on your system. This section also covered the concept of delivering signals and the default actions associated with a signal.

The second section demonstrated two methods of signal handling. The first method is to catch signals and handle them using a signal handler. The second method is to ignore signals. Finally, we explored the use of signals to set up a timer.

Get Sams Teach Yourself Shell Programming in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.