Questions tagged «exitstatus»

8
命令失败怎么退出?
我是shell脚本方面的菜鸟。如果命令失败,我想打印一条消息并退出脚本。我试过了: my_command && (echo 'my_command failed; exit) 但它不起作用。它会继续执行脚本中此行之后的指令。我正在使用Ubuntu和bash。
222 linux  bash  exit  exitstatus 

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.