3 While Loop in Shell Script

Program:

#!bin/bash

echo " Program to Demonstrate While Loop:";

printf " Enter a Number: ";
read num

i=0 

while [ $i -lt $num ]
do
   echo $i;
   i=`expr $i + 1`
done



Output:



Previous
Next Post »