shell脚本立刻结束
时间: 2023-10-12 22:05:01 浏览: 92
有些程序在停止之后并没能立即退出,就例如有一个 tomcat 挂了,就算是用 kill -9 命令也还没瞬间就结束掉。因此,如果shell还没等其退出就接着执行下一行,就可能出现问题。为了解决这个问题,可以使用shell的sleep命令来延迟执行下一行,等待程序完全退出后再继续执行下一行代码。这样就可以保证shell脚本能够立刻结束。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Shell脚本中让进程休眠的方法(sleep用法)](https://download.csdn.net/download/weixin_38738783/14094165)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [shell 脚本- 启动或关闭应用进程](https://download.csdn.net/download/weixin_38742291/14055714)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [使用Linux的Shell脚本定时处理MySQL超时](https://download.csdn.net/download/weixin_38598613/13690909)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文