On Ubuntu, I would like to end up with a disk file that reads:
foo $(bar)
I would like to create this file using the cat command, e.g.
cat <<EOF > baz.txt
type_magic_incantation_here_that_will_produce_foo_$(bar)
EOF
The problem is the dollar sign. I have tried multiple combinations of backslash, single-quote, and double-quote characters, and cannot get it to work.