Linux

&& || !

2020-03-07  本文已影响0人  云养江停

!expr 对 expr 求反

expr1 && expr2 对 expr1 与 expr2 求逻辑与, 当 expr1 为假时不再执行 expr2

expr1 || expr2 对 expr1 与 expr2 求逻辑或, 当 expr1 为真时不再执行 expr2

command1 && command2 && command3...

只有 && 左边的命令返回真,&& 右边的命令才会被执行。

command1||command2

||与&&相反。如果||左边的命令(command1)未执行成功,那么就执行||右边的命令(command2)。

上一篇 下一篇

猜你喜欢

热点阅读