View Single Post
  #6   (View Single Post)  
Old 12th March 2012
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Quote:
Originally Posted by aleunix View Post
These attempt failed:
for i in {$1.. $2}
{ .. } is a bash-ism not found in ksh.

Quote:
for ((i=$1; i <= $2 ; i++))
The (( )) should contain an arithmetic expression, rather than a command list.


Quote:
now i'm using that approach:
i=$1
while [ "$i" -le $2 ]
do
echo $i
let "i+=1"
done
I haven't check on Linux ...
I checked and it works.
Reply With Quote