天天看點

shell 函數傳回值

傳回值使用$?接收

function myfunc()

{

echo $1+$2

}

echo $(myfunc 1 2)

ret = $(myfunc 1 2)

echo $ret