O'Reilly logo

Expert Shell Scripting by Ron Peters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 17Automating User Input withexpect

The expect utility's name suggests precisely what it does: "expect" some output from an interactive program, and send the program some input in response. expect has much more functionality than I cover in this chapter, but this chapter provides a good example of how it can be used. To find more complete information, you can consult the expect manual page.

You may find that when you try to automate a task, the utilities or tools you are using don't lend themselves well to scripting. In the past, use of the format or fdisk command (along with many others) was difficult to automate. Today we have versions of these utilities, such as sfdisk, that are much easier to use within a script. A more modern use ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required