Header Ads

Shell Scripting : Example of a Simple For Loop - 04

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

Program Code:

#!/bin/bash
#Simple for Loop Usage

echo " Value of N : "
read n

for ((i=1; i<=n; i++))
do
 echo " Loop Counter is : $i"
done

Program Output:

No comments