#!/bin/bash #存储为a.sh if [ $1 == 100 ] then return 0 #参数正确,返回0 else return 1 #参数错误,返回1 fi
#!/bin/bash
#存储为b.sh
echo $?
$ . ./a.sh 100 $ . ./b.sh 0
shell控制流程
原文:https://www.cnblogs.com/xiufengchen/p/10396782.html