Quick Table of Contents
Shell scripting - looping and counting
1. Counting to 100 using for loop
#!/bin/sh
for (( i=1 ; ((i-100)) ; i=(($i+1)) ))
do
echo $i
done;
The 2nd expression in the for loop must evaulate to 0 so that the loop will finish. This looks a bit unnatural compared to normal programming languages. Instead consider using a while loop.

