This question already has answers here:
Closed 2 years ago.
I have a text like this:
foo bar
`which which`
If I do this using heredoc, I get a blank file:
➜ ~ echo <<EOT > out
heredoc> foo bar
heredoc> `which which`
heredoc> EOT
➜ ~ cat out
➜ ~
How can I do this?
Edit
Oh sorry, I meant to do cat
. Problem is that it writes this to the file: which: shell built-in command
, ie, evaluations backticks. Any way to do this without evaluating?
With cat
, I get
➜ ~ cat <<EOT > out
heredoc> foo bar
heredoc> `which which`
heredoc> EOT
➜ ~ cat out
foo bar
which: shell built-in command
➜ ~
I don't want which which
to be evaluated.