Hi all,
I am very new to BASH shell programming. I need to return an integer from a function to the caller function. I did this:
but it keeps giving me wrong return:
Can someone help me out here, please?
Thanks
Hi all,
I am very new to BASH shell programming. I need to return an integer from a function to the caller function. I did this:
but it keeps giving me wrong return:
Can someone help me out here, please?
Thanks
Return codes cannot be more than one eight bit byte can represent. Start with 0-127
If you need to return a string or some arbitrarily large number -
function func {
ret=5543
echo "Return code should be 5543"
echo "$ret"
}
return_value=$( func )
echo "return_value = $return_value"
great! Thanks!