While loop - Linux Shell Scripting Tutorial - A Beginner's handbook
while IFS= read -r line do command1 on $line command2 on $line .. .... commandN done < "/path/to/filename ... while loop Example Create a shell script called while.sh: #!/bin/bash # set n to 1 n = 1 # continue until $n equals 5 while [$n-le 5] do echo $n ...