Assign the returned value of a function to a variable‎ in unix ...

Assign the returned value of a function to a variable‎ in unix ...

瀏覽:749
日期:2025-06-09
2012年10月16日 - The value returned by the function is stored in $? , and is not captured by $() . In other words: testfunction() { k=5; echo 3; return $k; } val=$(testfunction) ......看更多