I want to substitute an echo command followed with | (pipe). For example,
$(echo "echo 'hello' | cat")
returns
'hello' | cat
I expect this to behave like
echo 'hello' | cat
which returns
hello
but that's not the case. Why?
PS. I'm aware of eval, and
eval $(echo "echo 'hello' | cat")
works as expected