bash:loops:while_loop
Table of Contents
BASH - Loops While loop
A while loop is used for running some instruction multiple times:
Format
while [ condition ] do commands 1 commands n done
NOTE: The space surrounding the square brackets is mandatory.
Example
#!/bin/bash i=0 while [ $i -le 2 ] do echo Number: $i ((i++)) done
bash/loops/while_loop.txt · Last modified: 2021/01/26 12:10 by peter