linux:shell 编程 条件判断 以及 判断条件

来源:互联网 发布:less.js下载 编辑:程序博客网 时间:2024/05/21 14:07







判断语句

test -e 文件  判断文件是否存在

或者

[ -e 文件 ]


对其中一些判断的解析

-nt-> newer than

-ot-> older than

-ef -> equal than

-eq -> equal 

-ne -> not equal

-gt -> greate than

-lt -> lower than

-ge -> greate equal

-le -> lower equal

-z -> zero

-n ->non empty

-a -> and

-o -> or

! -> non


0 0
原创粉丝点击