美文网首页
Linux: exit

Linux: exit

作者: LET149 | 来源:发表于2023-11-01 09:34 被阅读0次

用来退出对脚本的执行

zhiyong@zhiyong-Inspiron-5423:~/Learn$ cat pp.sh 
#! /bin/bash

echo "hello world!"
exit  #退出对当前脚本的执行,下面的命令都不会被执行
echo "hello world!"

zhiyong@zhiyong-Inspiron-5423:~/Learn$ sh pp.sh 
hello world!  #只执行exit之前的命令
zhiyong@zhiyong-Inspiron-5423:~/Learn$

相关文章

网友评论

      本文标题:Linux: exit

      本文链接:https://www.haomeiwen.com/subject/bhunwktx.html