Subshells! A simple test. $ cat > test.md << EOF > Just some text here > EOF $ msh -c "cat '$(echo test.md)'" Just some text here $ msh -c "'$(which echo)' hello" hello $ msh -c "`which echo` hello" hello