[Linux]Integer expression expected
shell脚本中判断cpu是否超过80%CPU=`top -b -d0.5 -n2|grep Cpu|sed -n '2p'|awk '{print $2}'|awk -F'%' '{print $1}'`if [ $CPU -gt 80 ];then echo "warning"fi执行报错:Integer expression expected。因为结果为小数,无法和整型数字作比较。可以用bc命令转换:if [[ $(echo "$CPU >