当前位置:网站首页>Exit of shell internal value command
Exit of shell internal value command
2022-06-26 07:23:00 【TimeFriends】
Shell Internal value command exit
Introduce :
exit Used to exit the current shell The environment process ends running , And you can return a status code . In general use $? You can get the status code .
grammar :
Correct exit Syntax exit # The default return status code 0 , Generally, it means that the command is executed successfully
Bad exit Syntax exit Not 0 Numbers # Range of digital recommendations 0-255 Generally, it means that the command execution fails
exit Application scenarios
1. End the present shell process
2. When shell An error occurred while the process was executing. When exiting , Different status values can be returned to represent different errors .
For example, when operating a file in a script file , Can return 1 Indicates that the file does not exist ,2 Indicates that the file does not have read permission ,3 Indicates that the file type is incorrect .
example
demand : To write shell Script use exit sign out , When exiting, return a non 0 Digital status value , Execute the script file and print the return status value
step :
1. establish exit.sh file
2. edit exit.sh file , Use exit Digital exit ends the current shell
3. Executable files , Print the return status value
demonstration
vim exit.sh
#!/bin/bash
echo 'hello'
exit 2
echo 'word'
# perform exit.sh
sh exit.sh # Only output hello
echo $? # Output 2 Get the status code returned by the last command execution
Summary
exit Application scenarios of
End the present shell process
You can return different status codes , Used for different business processing
边栏推荐
- Sanic based services use celery to complete dynamic modification timing tasks
- php array_merge详解
- 数据中心灾难恢复的重要参考指标:RTO和RPO
- QPS
- Golang源码包集合
- 十大证券公司哪个佣金手续费最低,最安全可靠?
- . Net 20th anniversary! Microsoft sends a document to celebrate
- 大厂面试TCP协议经典十五连问!22张图让你彻底弄明白
- [image enhancement] image defogging based on artificial multiple exposure fusion amef with matlab code
- Which of the top ten securities companies has the lowest commission fee and is the most safe and reliable?
猜你喜欢

安装homebrew报错汇总

Service interface test guide

Mxnet implementation of network in Nin network

When asked during the interview, can redis master-slave copy not answer? These 13 pictures let you understand thoroughly
![5,10,15,20-tetra (4-bromophenyl) porphyrin (h2tppbr4) /5.2.15,10,15,20-tetra [4-[(3-aminophenyl) ethynyl] phenyl] porphyrin (tapepp) Qiyue porphyrin reagent](/img/2b/837dfa0f80c31c2903927085c491df.jpg)
5,10,15,20-tetra (4-bromophenyl) porphyrin (h2tppbr4) /5.2.15,10,15,20-tetra [4-[(3-aminophenyl) ethynyl] phenyl] porphyrin (tapepp) Qiyue porphyrin reagent

If you don't understand, please hit me

卡尔曼滤波器_Recursive Processing

Shengshi Haotong enterprise wechat sector creates a digital ecological community

13. Mismatch simulation of power synthesis for ads usage recording

QTreeWidget And QTableWidget
随机推荐
If you don't understand, please hit me
Network IO, disk IO
How to publish function computing (FC) through cloud effect
5,10,15,20-tetra (4-bromophenyl) porphyrin (h2tppbr4) /5.2.15,10,15,20-tetra [4-[(3-aminophenyl) ethynyl] phenyl] porphyrin (tapepp) Qiyue porphyrin reagent
$a && $b = $c what???
大厂面试TCP协议经典十五连问!22张图让你彻底弄明白
ZRaQnHYDAe
[image fusion] MRI-CT image fusion based on gradient energy, local energy and PCA fusion rules with matlab code
In depth analysis of redis object structure
Analyze 5 indicators of NFT project
Redis series - five common data types day1-3
报错问题Parameter index out of range(0 < 1) (1 > number of parameters,which is 0
The first screen time, you said you optimized it, then you calculated it and showed it to me!
Multisensor fusion sensing
Tetradecanoxy tetraphenylporphyrin methacrylate mm-tpp-14c; Cetanoxy tetraphenyl porphyrin methacrylate mm-tpp-16c; Purple solid; Qiyue supply
【推荐10个 让你轻松的 IDEA 插件,少些繁琐又重复的代码】
5,10,15,20-tetra (4-methoxycarbonylphenyl) porphyrin tcmpp purple crystal; Meso-5,10,15,20-tetra (4-methoxyphenyl) porphyrin tmopp|zn[t (4-mop) p] and co[t (4-mop) p] complexes
Item2 installation configuration and environment failure solution
[feature extraction] feature selection of target recognition information based on sparse PCA with Matlab source code
Crosslinked metalloporphyrin based polyimide ppbpi-h) PPBP Mn; PBP-Fe; PPBPI-Fe-CR; Ppbpi Mn CR product - supplied by Qiyue