Chapter 8. Decisions, Decisions
IN THIS CHAPTER
This chapter introduces a statement that is present in almost all programming languages:
if. It enables you to test a condition and then change the flow of program execution based on the result of the test.
The general format of the
if command is
if commandt then command command ... fi
where commandt is executed and its exit status is tested. If the exit status is zero, the commands that follow between the
then and the
fi are executed; otherwise, they are skipped.
Whenever any program completes execution under the Unix system, it returns an exit ...