shell script - Returning a value from a bash function - Unix & Linux Stack Exchange

shell script - Returning a value from a bash function - Unix & Linux Stack Exchange

瀏覽:1395
日期:2025-10-03
@choroba's answer is correct, however this example might be clearer: valNum $num valNumResult=$? # '$?' is the return value of the previous command if [[ $valNumResult -eq 1 ]] then : # do something fi This example is a little longer (setting $valNumResul...看更多