Hi,
I have always encountered this problem in ubuntu bash shell scripts that echo command in a function will be treated as a return value when used in a function.
e.g.
Code:
function abc
{
echo "xyz"
}
returnVal=$(abc)
echo "Return value = $returnVal"
This would give the output
Return value = xyz
However, if I used:
Code:
function abc
{
echo "xyz"
}
abc
The output would simply be xyz.
Hence the echo seems to function as a "return" command when used in a function with a return value.
Any workaround to this?