求大佬解决一下问题
#!/bin/bash#
order=`history | sed 's@^[[:space:]]*@@g' | cut -d' ' -f1 | tail -1`
echo "the history sum is :$order."
if [ $order -gt 1000 ];then
echo "some command will gone"
else
echo "OK"
fi
报错信息
the history sum is :.
/mnt/hc.sh: line 5: [: -gt: unary operator expected
OK
{:6_276:} order没有值,或值不是整型,导致下面没有可比性。没法用GT 666666666666666666666666666666666666 66666666666666666666666666666666 666666666666666666666666666666666 66666666666666666666666666666666666666666 666e66666666666666666666666666666666 6666666666666666666666666666666666666666666666 6666666666666666666666666666666666666666666 6666666666666666666666666666666666666666666666666 6666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666 6666666666666666666666666666{:6_264:}
页:
[1]
2