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

清疚 2022-08-10 00:47 391阅读 0赞

20151105215435846

20151105220218806

20151105220613566

20151105220942102

20151105221155506

20151105221431425

20151105221538552

判断语句

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 条评论,391人围观)

还没有评论,来说两句吧...

相关阅读

    相关 if 判断条件

    所有的对象都被当做true, 当且仅当字符串为空时,该字符串被当做false, null 和 undefinend 被当作false, 当且仅当数字为零时,该数字被当做f