The purpose of this appendix is to review major Bourne shell
sh) programming features. It is not intended as a comprehensive treatment of shell
programming or of the features of the various shells. Rather,
it will enable you to understand and modify the system administration
scripts on your system, most of which are Bourne shell scripts (although
this is slowly changing).
In the course of this appendix, we will look at many examples drawn from actual system scripts, as well as some other simple examples to illustrate basic features. Some of the latter examples use shell commands executed at the command prompt (although the corresponding commands could obviously appear just as easily in scripts).
With the exception of AIX and Linux, the Unix versions we are
considering use the Bourne shell for system scripts. AIX uses the Korn
ksh), and Linux uses the
Bourne-Again shell (
bash). Linux system
scripts also frequently use
features that are not part of the standard shell. Since they are
sh, however, the most
important of these features are now described in this appendix. When I mention
features here, I am doing so in a descriptive sense only—not in an
historical sense—in comparison to what is offered in the standard Bourne shell. The feature in question
may also be present in other shells and may very well have originated in a
shell other than
The books UNIX in a Nutshell: System V Edition, by Arnold ...