Search code examples
shellksh

Iterating through a range of ints in ksh?


How can I iterate through a simple range of ints using a for loop in ksh?

For example, my script currently does this...

for i in 1 2 3 4 5 6 7
do
   #stuff
done

...but I'd like to extend the range way above 7. Is there a better syntax?


Solution

  • Curly brackets?

    for i in {1..7}
    do
       #stuff
    done