I am working with a bash script and I want to execute a function to print a return value:
function fun1(){ return 34}function fun2(){ local res=$(fun1) echo $res}
When I execute fun2
, it does not print "34". Why is this the case?
I am working with a bash script and I want to execute a function to print a return value:
function fun1(){ return 34}function fun2(){ local res=$(fun1) echo $res}
When I execute fun2
, it does not print "34". Why is this the case?