脚本——1-100奇数的和

#!/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

原文地址:https://www.cnblogs.com/hyydeali/p/12838603.html