ksh while loop

hi all,

got this silly problem and i just can't seem to make sense of the error message its is saying 1400: cannot open. its my first time at writing a while loop but tried all sorts to get it working without success.

#!usr/bin/ksh

integer max=1400
set file="afilename"
integer i=1

while i < $max
do
# $(echo value of is : $i >> $file)
echo value i: $i
i = $i + 1
done

thanks

Mani

#!usr/bin/ksh

integer max=1400
set file="afilename"
integer i=1

while [[ $i -lt $max ]]
do
# $(echo value of is : $i >> $file)
echo value i: $i
(( i = i + 1 ))
done

Another "mathematical way":

max=1400
set file="afilename"
i=1

while (( i <= max ))
do
   # $(echo value of is : $i >> $file)
   echo value i: $i
   (( i += 1 ))
done

thanks got it working.:slight_smile: