shell-判断表达式

2019-08-08  本文已影响0人  _str_

shell-6-判断表达式

test

image
image
image
image
image
image

判断符号

[ -z "${HOME}" ]; echo $?   判断字符串是否为0 为空的话输出true 后面的 echo $? 输出为0 显示上次输出正确

在中括号 [] 内的每个元件都需要有空白键来分隔
在中括号内的变量,最好都以双引号括号起来

上一篇 下一篇

猜你喜欢

热点阅读