Chapter 9. Repetitive tasks

Table of Contents
9.1. The for loop
9.1.1. How does it work?
9.1.2. Examples
9.2. The while loop
9.2.1. What is it?
9.2.2. Examples
9.3. The until loop
9.3.1. What is it?
9.3.2. Example
9.4. I/O redirection and loops
9.4.1. Input redirection
9.4.2. Output redirection
9.5. Break and continue
9.5.1. The break built-in
9.5.2. The continue built-in
9.5.3. Examples
9.6. Making menus with the select built-in
9.6.1. General
9.6.2. Submenus
9.7. The shift built-in
9.7.1. What does it do?
9.7.2. Examples
9.8. Summary
9.9. Exercises

Upon completion of this chapter, you will be able to

  • Use for, while and until loops, and decide which loop fits which occasion.

  • Use the break and continue Bash built-ins.

  • Write scripts using the select statement.

  • Write scripts that take a variable number of arguments.