linux之shell命令——条件判断(&& || test)

&& 和 || &&:用来执行条件成立后执行的命令 ||:用来执行条件不成立后的执行命令 示例: [[email protected] mnt]# id toto # 用户toto不存在无法查看 id: toto: no such user [[email protected] mnt]# id toto &> /dev/null && echo yes || echo no # 判断用户是
相关文章
相关标签/搜索