整数运算
num=`expr 2 + 2`
echo "$num"
结果: 4
a=55
b=45
echo `expr $a + $b`
结果: 100
浮点数运算
if [ `echo "1.05 < 1.001" | bc` -eq 1 ];then echo "OK"; else echo "NO"; fi
if [ `echo 6.354 > 6.353|bc` -eq 1 ]
then
x='ok'
else
x='on'
fi
while [ $x == 'ok' ]
do
for f in {1..10}
do
echo "$f"
done
break
done