Exploring Expect: A Tcl-based Toolkit for Automating Interactive Programs (Nutshell Handbooks) 1st Edition
| Don Libes (Author) Find all the books, read about the author, and more. See search results for this author |
Use the Amazon App to scan ISBNs and compare prices.
- Highlight, take notes, and search in the book
Expect is quickly becoming a part of every UNIX user's toolbox. It allows you to automate Telnet, FTP, passwd, rlogin, and hundreds of other applications that normally require human interaction. Using Expect to automate these applications will allow you to speed up tasks and, in many cases, solve new problems that you never would have even considered before.For example, you can use Expect to test interactive programs with no changes to their interfaces. Or wrap interactive programs with Motif-like front-ends to control applications by buttons, scrollbars, and other graphic elements with no recompilation of the original programs. You don't even need the source code! Expect works with remote applications, too. Use it to tie together Internet applications including Telnet, Archie, FTP, Gopher, and Mosaic.Don Libes is the creator of Expect as well as the author of this book. In Exploring Expect, he provides a comprehensive tutorial on all of Expect's features, allowing you to put it immediately to work on your problems. In a down-to-earth and humorous style, he provides numerous examples of challenging real-world applications and how they can be automated using Expect to save you time and money.Expect is the first of a new breed of programs based on Tcl, the Tool Command Language that is rocking the computer science community. This book provides an introduction to Tcl and describes how Expect applies Tcl's power to the new field of interaction automation. Whether your interest is in Expect or interaction automation or you simply want to learn about Tcl and see how it has been used in real software, you will find Exploring Expect a treasure trove of easy-to-understand and valuable information.
Customers who viewed this item also viewed
Editorial Reviews
From the Publisher
About the Author
Don Libes is married to Susan Mulroney, a professor in the Department of Physiology and Biophysics at the Georgetown University School of Medicine. Sue performs research in the area of kidney growth and development. Their well-hydrated daughter, Kenna, has two lovely kidneys.
Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Product details
- ASIN : 1565920902
- Publisher : O'Reilly Media; 1st edition (December 27, 1994)
- Language : English
- Paperback : 606 pages
- ISBN-10 : 9781565920903
- ISBN-13 : 978-1565920903
- Item Weight : 2.07 pounds
- Dimensions : 7 x 1.3 x 9.19 inches
- Best Sellers Rank: #1,155,245 in Books (See Top 100 in Books)
- #337 in Unix Operating System
- #690 in Computer Operating Systems (Books)
- #704 in Linux Operating System
- Customer Reviews:
About the author

Discover more of the author’s books, see similar authors, read author blogs and more
Customer reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
The general problem occurs when a send command is followed by an expect command. The normal echoing of the command sent will be processed by the expect command. This is not an issue in the simplest of examples, and the simplest of examples is all that one finds in the first 160 pages of the book. I ran into an issue when I had send followed by expect and my expect pattern was a regular expression. I contend that this problem should be highlighted BOLDLY at least by the end of the chapter on Regular Expressions. And probably in the preceding chapter on Glob Patterns. But again, the few examples of send followed by expect in the RE chapter do not highlight my issue.
Typically, an index, and I have not gotten much pleasure from the index in this book, is not a solution for this because one would not know what to search for when the problem strikes. Only having basic information in the basic part of the book is a solution. The author simply was not born to be a great teacher, despite his otherwise formidable credentials.
To those ends, I wasn't disappointed. Expect makes it possible to automate tedious interactive work at the interface level. One can write concise, if not elegant, scripts. The cost of brevity, as if often the case with tools of this sort, is directly proportional to one's ignorance of expect's features and how they are implemented. And, if you'd like to approach Tcl by way of example, expect is as good a choice as I've come across.
This guide, on the other hand, is often a discouraging chore to read. It's as if a shoebox of index cards, each detailing one specific feature, was sorted through and applied to flesh out the book's outline. Taken individually, these elements do make sense, providing sometimes useful examples, sometimes curious tangents, sometimes tedious cautionary tales of edge cases. Taken as a whole, it's difficult to see the forest for the trees in this guide. One could say this book is good reference material; it is indexed well, and the outline is clear enough. If it had a reference style, I could see that point.
The book however has an expository form. It employs inline cross-references and footnotes where a sidebar or a simple table would have been a welcome relief from flipping back and forth. These research-style choices enforce the idea that the book was assembled from notes, and never quite realized as a whole guide. As a result, it's closer in feel to a set of anecdotes than a reference guide. It is a style that, as an instructor, I find often discourages users, primarily beginners or others who do not have a formal technical education.
Expect is of course a valuable tool. I'm grateful to the author for making it and sharing it. I'm also surprised, however, that in the last 15 years no one has thought they could do a better job in explaining, and therefore promoting, such a useful application.
THe best thing about expect is that instead of just firing off commands via shell script, it can interact with those commands. For example if you write a script that uses SSH, SSH can give you multiple different responses asking for passphrase, password, accept public key from server. Expect can work like a switch statement to handle all of these:
expect {
-re "\[P|p]assword" {
send "$passwd\r"
exp_continue
}
"Are you sure you want to continue connecting" {
send "yes\r"
}
-re "\[P|p]assphrase" {
send "$passphrase\r"
exp_continue
-re $prompt
}
Very simple.
I like how the author addresses issues of portability without obsessing on it.
I really like the Exercises at the end of each chapter. I only wish the author would apply a difficulty rating to each exercise because sometimes I can't tell if an exercise is intrinsically very difficult (some are definitely so) or if I need to review parts of the chapter to see why I can't just instantly 'get it.' In any event, the exercises are stimulating and would require a long time and careful thought to do them all. I would buy a book that had the answers, with commentary, to all the exercises.
Top reviews from other countries
The tcl/expect utility can stil be relevant - and I learnt much about TCL, Expect and regular expressions since buying this book. Well written with good humour.




