美文网首页Linux
shell| 字符串比较

shell| 字符串比较

作者: 明明德撩码 | 来源:发表于2018-01-27 16:23 被阅读156次

必须放到[]中

=等于则为真
!=不相等则为真
n not zero 字符段长度不为0
z zero表示字符段长度位0

= 和!=的样例

image.png

-z 和-n的样例

image.png

实际样例 vi /etc/init.d/nfs

image.png

-o 或者

image.png

相关文章

网友评论

    本文标题:shell| 字符串比较

    本文链接:https://www.haomeiwen.com/subject/bpbnaxtx.html