Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Viewing all articles
Browse latest Browse all 206

Return value in a Bash function

$
0
0

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?


Viewing all articles
Browse latest Browse all 206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>