Je prefere la deuxieme solution :
function myfunc()
{
local myresult='some value'
echo "$myresult"
}
result=$(myfunc) # or result=myfunc
echo $result
-
http://www.linuxjournal.com/content/return-values-bash-functions