How to cat <> a file containing code?
You only need a minimal change; single-quote the here-document delimiter after <<. or equivalently backslash-escape it: Without quoting, the here document will undergo variable substitution, backticks will be evaluated, etc, like you discovered. If you need to expand some, but not all, values, you need to individually escape the ones you want to prevent. will produce … Read more