vim sum100.sh
#!/bin/bash
I=1
SUM=0
for I in {1..100}
do
let SUM+=$I                   #也可以替换成 SUM=`expr $SUM + $I`
let I++                       #也可以替换成 I=`expr $I + 1`   
echo "The sum is $SUM"
2、vim sum100.sh
I=1
SUM=0
while [ $I -le 100 ]
do
let SUM+=$I
let I++
done
echo "The sum is $SUM"
3、vim sum100.sh
#!/bin/bash
I=1
SUM=0
until [ $I -gt 100 ]
do
let SUM+=$I
let I++
done
echo "The sum is $SUM"