Loops are one of the fundamental concepts of programming languages. Loops are handy, if you want to run series of commands over and over again, until a certain condition is reached. In scripting languages such as Bash, loops are useful for automating repetitive tasks. There are 3 basic loop constructs in Bash scripting, for loop, while loop, and until loop. This tutorial explains the basics of while loops in Bash as well as the break and continue statements to alter the flow of a loop.
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.