当前位置:网站首页>How can a shell script (.Sh file) not automatically close or flash back after execution?
How can a shell script (.Sh file) not automatically close or flash back after execution?
2022-06-24 12:15:00 【Dust_ Evc】
Shell The script is very proud , When something goes wrong 、 After the implementation, you will not be given a chance to view the error information 、 Output information , Go straight back .
I don't say much nonsense , The training method is as follows , Directly in Shell Add the following code to the end of the script :
# Use read The command achieves something similar bat Medium pause Command effect
echo Press any key to continue
read -n 1
echo Continue operation example :
some .sh The file contents are shown below , Directly flash back after execution or error .

Add the code at the end :

such , After running error 、 After execution , You can have enough time to view the error message 、 Output information . Press any key to close the window or click close window .

in addition , utilize sleep Command to realize window delay closing and other examples can be referred to :
边栏推荐
- TP-LINK 1208 router tutorial (2)
- Beauty of script │ VBS introduction interactive practice
- How to open a new bond? Is it safe to open an account
- Embedded must learn! Detailed explanation of hardware resource interface - based on arm am335x development board (Part 2)
- 广发证券靠谱吗?开证券账户安全吗?
- Why are some old SEO methods still effective?
- 集群控制管理
- TP-LINK 1208路由器教程(2)
- Give you a server. Can you deploy your code online?
- What code did the full stack programmer write this month?
猜你喜欢

Beauty of script │ VBS introduction interactive practice

qt -- QTabWidget 中支持拖拽TabBar项
[Architect (Part 41)] installation of server development and connection to redis database

TP-LINK 1208 router tutorial (2)
【老卫搞机】090期:键盘?主机?全功能键盘主机!

我真傻,招了一堆只会“谷歌”的程序员!

@Requestbody annotation

Group counting_ Structure and workflow of CPU

Install Kali on the U disk and persist it

Tools and methods - use code formatting tools in source insight
随机推荐
集群控制管理
Popular science of data annotation: ten common image annotation methods
链接器 --- Linker
Is it safe to apply for new bonds to open an account
10 zeros of D
Influence of DEX optimization on arouter lookup path
What code did the full stack programmer write this month?
炒伦敦金短线稳定赚钱技巧?在哪里炒伦敦金安全靠谱?
[206] use PHP language to generate the code of go language
GLOG from getting started to getting started
Opencv learning notes - cv:: mat class
9+!通过深度学习从结直肠癌的组织学中预测淋巴结状态
Adobe Photoshop using the box selection tool for selection tutorial
Axi low power interface
9+! Predicting lymph node status from histology of colorectal cancer by deep learning
工具及方法 - 在Source Insight中使用代码格式化工具
GTest从入门到入门
【老卫搞机】090期:键盘?主机?全功能键盘主机!
2022年有什么低门槛的理财产品?钱不多
《opencv学习笔记》-- CV::Mat类