是否有任何方法可以在单行命令中同时使用||和&&?
||
&&
我正在尝试做相当于python的事情:
import os doSomething() if os.system("[[ -f hello.txt ]]") else doSomethingElse()
在您的python示例中没有“ AND”,在吗?
在bash中,我将其简单写为
if [ -f hello.txt ]; then doSomething else doSomethingElse fi