shell调用其它脚本的函数bash shellname.sh 12345678910test_func(){ local p1="$1" if [ "$p1" == "" ]; then echo "1 null" return 1 fi echo "1 ${p1}" return 0} 12345678. ./shellname.shres=`test_func "123"`if [ $? != "0" ]; then echo "fatal"else echo "ok"fi