#!/bin/bash
a=0
sum=0
while true
do
let a++
if [ $a -le 100 ] && [ `expr $a % 2` -eq 0 ]
then
if [ $a -eq 100 ]
then
break
fi
else
let sum=sum+a
fi
done
echo $sum
#!/bin/bash
a=0
sum=0
while true
do
let a++
if [ $a -le 100 ] && [ `expr $a % 2` -eq 0 ]
then
if [ $a -eq 100 ]
then
break
fi
else
let sum=sum+a
fi
done
echo $sum