Link to home
Start Free TrialLog in
Avatar of smiley020999
smiley020999

asked on

endless loop in ksh

i have a ksh script like this:

#!/bin/ksh

for i in 1 2 3 4 5 6 7 8 9 10
do
something
done

now i want it loop endless when i value is from 1 to 10, so i add a loop like this:

#!/bin/ksh

loop:

for i in 1 2 3 4 5 6 7 8 9 10
do
something
done
goto loop

but this didn't work.how to make it work?
Avatar of ozo
ozo
Flag of United States of America image

while [ 1 ] ; do
    for i in 1 2 3 4 5 6 7 8 9 10
    do
        echo $i
    done
done
Avatar of kellyjj
kellyjj

ozo pretty much hit it on the head.  
ASKER CERTIFIED SOLUTION
Avatar of drosseel
drosseel

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial