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

我们如何使用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.

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...