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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…