Header Ads

Shell Scripting : Example of a Simple while Loop - 05

This is a Simple usage Example of a 'while' loop in Shell Scripting. 

Program Code:

#!/bin/bash
#Simple while Loop Usage

loop=1
while [ $loop -le 5 ]
do
 echo " Looping : $loop"
 loop=$(($loop + 1))
done

Program Output:

No comments