#!/bin/bash #user: yp export NUM=44 function func(){ local a=44 printf "$a\n" } num=`func` if [ "$num" == $NUM ];then echo "func is run!!" else echo "func not run!!!" fi
#!/bin/bash export NUM01=50 export NUM02=60 if [ $NUM01 -lt $NUM02 -a $NUM02 -gt $NUM01 ];then #逻辑与 echo "all ok" fi if [ $NUM01 -gt $NUM02 -o $NUM02 -gt $NUM01 ];then #逻辑或 echo "ok" fi