Automating Scripts with here Documents and expect
So, exactly where is here? Well, I suppose that it’s just where I happen to be, or from your own perspective, wherever you happen to be. The bigger mystery, which nobody seems to have figured out, is why a very useful shell scripting construct has such a strange name.
A here document, which can also be called a here script or a heredoc, isn’t really a document, and it has nothing to do with anyone’s current location. But, as you shall soon see, it’s extremely useful in a number of different ways, such as in automating your scripts.
The second automation method I’ll show you is expect, which is a scripting environment with its own scripting language.
Topics in this chapter include:
- Using here Documents
- Automating responses with expect
All right, let’s get ready to automate!