1. 程式人生 > >linux shell中邏輯與,或表示式

linux shell中邏輯與,或表示式

與&&

1)if [ $str=a -a $str=b ] 

2)if [ $str=a ] && [  $str=b ]
或||:
1)if [ $str=a -o $str=b ] 
2)if [ $str=a ] || [  $str=b ]