shell 脚本中&和&&的区别

& means “run command in the background.
“command1 && command2 means “run command1 and if it completes successfully, run command2 afterwards.”So you should probably use &&. You would use & if you want both commands to run simultaneously.

a & b 表示a和b同时运行
a && b表示 a运行成功后再运行b

    原文作者:Jalon
    原文地址: https://www.jianshu.com/p/1f8996860d52
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞