8. 'Round and 'Round She Goes

In this chapter you’ll learn how to set up program loops. These loops will enable you to execute a set of commands either a specified number of times or until a specific end condition is met.

The three built-in looping commands for shell programming are

Image for

Image while

Image until

You’ll learn about each one of these loops in separate sections of this chapter.

The for Command

The for command is used to execute one or more commands ...

Get Shell Programming in Unix, Linux and OS X, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.