Reputation: 207
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
Upvotes: 0
Views: 308
Reputation: 1557
for ((i=100;i<1001;i+=10));
do
echo $i
sleep 1
done
Simply change ++
to += 10
Upvotes: 1