Looping Constructs
In the next several sections of this chapter, you are introduced to four types of looping mechanisms. A looping mechanism is what enables a script writer to repeat a sequence of lines as many times as necessary. Without looping capability, if you wanted to repeat the same three lines of commands five times, you would have to simply type the lines in repetitively in your script. Using a looping mechanism, a repeat sequence is formed and a test is evaluated to determine whether the looping should repeat. As you will see, the positioning of the test and the steps for executing the loop vary slightly for the four flavors of looping.
This clunky technique does work, by the way. But it certainly has no elegance to it. It's like going ...
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