A here document is a special-purpose code block. It uses a form of I/O redirection to feed a command list to an interactive program or a command, such as ftp, cat, or the ex text editor.

learn more… | top users | synonyms

1
vote
1answer
69 views

How do you embed strings within the comments within a heredoc?

This doesn't work, the comment doesn't contain the IP_ADDR string SSH_UN='user' IP_ADDR='192.168.1.101' cat <<"EOF" >> .ssh/config # VirtualBox (VB) on user's laptop at $IP_ADDR Host ...
11
votes
2answers
2k views

How do you escape characters in heredoc?

I'm working with a bash script trying to stop it from attempting to replace variables inside my heredoc. How do set a heredoc to either A) escape the variable names instead of parsing them or B) ...