I tried calling foo()inside a line like this:
echo "This is a ${foo()} car";
function foo() {
return "blue";
}
but it ends with a syntax error.
I found here something similar, but not quite what I need:
echo "This is the value of the var named by the return value of getName(): {${getName()}}";
Is it possible to do this?
source
share