Right now, I'm trying to nest one bash function call inside another function call (so that the output of one function is used as the input for another function). Is it possible to nest function calls in bash, as I'm trying to do here?
First, I defined these two functions:
returnSomething()
{
return 5;
}
funky ()
{
echo $1;
}
Then, I tried to use the output of one function as the input for the other function.
However, this next statement doesn't print the output of returnSomething
. Instead, it prints nothing at all.
funky $returnSomething; #Now I'm trying to use the output of returnSomething as the input for funky.
funky returnSomething
.$returnSomething
is a variable, not a call to the function.funky $(returnSomething)
returnSomething
to the console.