What do you think?
Rate this book
602 pages, Paperback
First published December 1, 1994
It is almost always easier to fix problems if you made some attempt at detecting them in the first place.
#!/usr/bin/expect --
# wait x seconds for a response and return it
# timedRead
# Don Libes, Exploring Expect, p. 77
# Modifications Jerry Stratton
# astoundingscripts.com
#help text
if {$argc != 1 || [lsearch $argv "--help"] > -1} {
puts "Usage: $argv0 "
puts "\twait seconds for a typed response, and return that response"
exit 1
}
set timeout $argv
expect "\n" {
send [string trimright "$expect_out(buffer)" "\n"]
}
All sorts of sins can be covered up in this way.