there is a simple bash shell fragment
function gettop()
{
abc= /bin/pwd
}
funret=$(gettop)
echo $funret
the output of funret is the ouput of command /bin/pwd:
/home/xxx/xxx
how does this happen?
according to shell standard, function return either with a echo or return, but here non of these involved; but the result show me that getopt returned /bin/pwd and $() just run this command.
another thing is, after I delete the extra empty space after abc= the output will become null;
what is going on here exactly?