shell比较浮点数

   1  t1="3123982193.090000000";
  2 t2="7872348342.003000000";
  3 if [ `expr $t2 > $t1` -eq 1  ] ; then                                                                            
  4     echo "t2 is big";
  5 fi
  6 echo $t2
~                                                                                                                     
~                                                                                                                     
~              
使用expr,返回1表示a>
a>b, 0表示a<
a<b

 a=6.6 b=5.5;expr $a > $b
原文地址:https://www.cnblogs.com/zhaocundang/p/10982333.html