0

So I have this loop:

for ((i=100;i<1001;i++));
do
     echo $i
     sleep 1
done

I want to know how I can add 10 every time the loop repeats instead of adding 1. So I want the loop to look something like this: 110 120 130 140 and keep going until it reaches the limit or stopped! Thanks

1
  • 1
    Change the i++ to whatever operation you want instead. Commented Apr 9, 2015 at 1:11

1 Answer 1

1
for ((i=100;i<1001;i+=10));
do
     echo $i
     sleep 1
done

Simply change ++ to += 10

Sign up to request clarification or add additional context in comments.

2 Comments

;) That's my first answer ever on stackoverflow.
I am glad you'll remember me! =)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.