The presence of file output yes, otherwise output no.
shell terminal to execute:
[ -f hello.txt ] && echo yes || echo no
-f 文件名字
True file exists.- Execution
[ -f hello.txt ]
is true is executedecho yes
, or the statement because the||
presence ofecho no
no longer perform. - In particular, where the logic and the logic or worthy of careful consideration.