1、if1.sh
#!/bin/bash
# 大小比较
NUM1=100
NUM2=200
if (($NUM1 > $NUM2));then
echo "this $NUM1 greate $NUM2"
else
echo "this $NUM1 less $NUM2"
fi
2、效果
[root@a lxy]# sh if1.sh
this 100 less 200
1、if1.sh
#!/bin/bash
# 大小比较
NUM1=100
NUM2=200
if (($NUM1 > $NUM2));then
echo "this $NUM1 greate $NUM2"
else
echo "this $NUM1 less $NUM2"
fi
2、效果
[root@a lxy]# sh if1.sh
this 100 less 200