Here’s a simple example of nesting a for loop inside another for loop: The nested loop (also called the inner loop) iterates through its values for each iteration of the outer loop. second pass of the outer loop triggers the inner loop The script initializes the variable n to 1, and then increments it by one. done BoxAdcontent.document.close(); This repeats until the outer loop finishes. again. Updated March 11, 2016. Loops are an important building block in a shell script which allows to iterate over a section of code. As a result, we have for and while loops in the Bourne shell. 9.2.2. PowerShell supplies at least four types of loops to cater for a variety of script logic. Loops and Branches: Next: 11.2. Of course, a break within either the inner or outer loop would interrupt this process. The inner while loop starts with a value of 1 and continues as long as the value is less than 5. Notice that there’s no difference between the do and done commands for the two loops. # using until and while loops BoxAdcontent.document.write("