shell编程中,如何将字符串转换成数字啊??
比如说,我有个文件tmp,其内容如下:
bignumber=008
我想写个脚本,实现如下功能:
smallnu=002
if [ -f temp ];then
bignu=`grep "^bignumber=" temp|sed 's/[^=]*=//'`
echo "bignu=$bignu"
if [ bignu <= smallnu ]; then
echo "erro!"
exit 1
else
echo "good!"
fi
fi
怎么做呢?这个脚本是错的。。。