我知道在Bash中,if语句可以使用expr来计算,方法是:
if [[ 5 > 0 ]]; then echo true; fiBash如何规避以下形式的if?
if [ 5 -gt 0 ]; then echo true; fi发布于 2011-12-27 21:44:58
第一个执行字符串字典比较,仅为bash,第二个执行数值比较,并在POSIX中工作。
第二个可以用bash更好地写成
if ((5 > 0)); then echo "true"; fihttps://askubuntu.com/questions/90889
复制相似问题