Unix/Linux Go Back    



WHILE LOOP CONDITION CHECK

Shell Programming and Scripting




Kindly Note - This is a Single User Post by Forum Member dashing201 Regarding:
WHILE LOOP CONDITION CHECK.
Please Follow The Primary Link Above to View the Full Discussion.

   
Old Unix and Linux 12-16-2009   -   Original Discussion by dashing201
dashing201 dashing201 is offline
Registered User
 
Join Date: Nov 2009
Last Activity: 10 October 2017, 8:13 AM EDT
Posts: 81
Thanks: 13
Thanked 0 Times in 0 Posts
WHILE LOOP CONDITION CHECK

Hello

I want to compare values of two variables as CHECK condition in a while loop.

eg:


Code:
var1=0 
var2=10   
while [ $var1 < $var2 ] 
do   
    echo " $var1 "
    var1=`expr $var1 + 1`
done

However this is giving error.How to do it in a proper manner?

Thanks.