[root@localhost ~]# cat exit.sh
#!/bin/bash
echo "please enter a string : "
read str1
if [ -z $str1 ]
then
echo "you enter is null"
exit 222
fi
[root@localhost ~]# sh exit.sh
please enter a string :
you enter is null
[root@localhost ~]# echo $?
222
shell-exit程序控制
最新推荐文章于 2021-04-07 10:07:34 发布