加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

bash – 只有在command1成功执行cmd windows shell时,才能运行co

发布时间:2020-12-15 19:12:47 所属栏目:安全 来源:网络整理
导读:我们如何使用cmd shell语言组合命令,以便仅在第一个命令成功完成时才执行第二个命令? 像以下bash命令 make ./a.out a.out只有在make成功的情况下才能执行 下列 command1 command2 也应该在cmd上工作。报价从here: When using cmd.exe,you can put multipl
我们如何使用cmd shell语言组合命令,以便仅在第一个命令成功完成时才执行第二个命令?

像以下bash命令

make && ./a.out

a.out只有在make成功的情况下才能执行

下列
command1 && command2

也应该在cmd上工作。报价从here:

When using cmd.exe,you can put multiple commands on the same line by using ‘&’ or ‘&&’ between commands. Using a single ampersand (&) will cause the first command and then the second command to be run in sequence. Using double ampersands (&&) introduces error checking. The second command will run only if the first command is successful.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读