天天看点

SHELL中获取函数返回值

终于找到办法了。

function test()
{
    echo abc
}
 
ret=`test`
echo 1=$ret
 
ret=$(test)
echo 2=$ret