我试图了解逻辑运算符优先级在 bash 中是如何工作的。例如,我会期望以下命令不会回显任何内容。
true || echo aaa && echo bbb
然而,出乎我的意料,bbb被打印出来了。
bbb
有人可以解释一下,我如何理解bash 中的复合&&和||运算符?
&&
||
shell bash
bash ×1
shell ×1