The while Loop – Linux Shell Programming
- While loops repeat statements as long as the next Unix command is successful.
For Example :
while [ $i -le 100 ]; do
sum=`expr $sum + $i`
i=`expr $i + 1`
echo The sum is $sum.
For any query or issue, feel free to discuss on http://discuss.eduguru.in