I want to pass the following group of bash commands
{ echo Apple; echo Banana; }
as an argument to a bash function defined in .bashrc as follows:
BashFunction(){
"$@" | SomeOtherFunction
}
BashFunction '{ echo Apple; echo Banana; }'
But I get this error:
{ echo Apple; echo Banana; }: command not found
If I remove the quotes from the bash function
BashFunction(){
$@ | SomeOtherFunction
}
Then I get this error
{: command not found
eval, but note that you're entering the danger zone.