shell脚本实现逻辑关系与、或、非

1,与  “-a” : a是and

if [  条件1 -a 条件2 ] ;then 

shell order

shell order

fi

2, 或 “-o” : o 是or

if [  条件1 -o 条件2 ] ;then 

shell order

shell order

fi

3,非 “!” : !是not

if [  ! 条件 ] ;then 

shell order

shell order

fi

      

    原文作者:dragon_cdut
    原文地址: https://blog.csdn.net/renlonggg/article/details/53997084
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞