As an alternative, we have included the do while loop. It is similar to a for loop, but better suited to dynamic conditions, such as when you do not know when a value will be returned or performing a task until a condition is met. The condition within the square brackets is the same as an if statement:
#!/bin/bashCTR=1while [ ${CTR} -lt 9 ]do echo "CTR var: ${CTR}" ((CTR++)) # Increment the CTR variable by 1doneecho "Finished"