Here Documents
No, this is not an example of what you do when you have a dog named documents and you want him to come to you. I have found that the concept of the here document has caused much weeping and gnashing of teeth among script writers. More specifically, this capability has caused heads to be scratched when trying to make changes or additions to production- or admin-level scripts.
I think the reason for all the uproar is that the syntax is not intuitive and the name “here document” doesn't bring a picture to mind. Let's review. The > symbol redirects output, and the >> symbol redirects output but appends to the target file rather than clobbering the target. The < symbol redirects input so that it comes from the file appearing after the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access