Expect is really cool, and you can use autoexpect to MAKE an expect script from a session, like a macro recorder!
Here is my script to just telnet to port 25 to see the Sendmail version:

set timeout 10
spawn telnet $argv 25
match_max 100000
expect -exact “sendmail”
send — “quitr”
expect eof

It was made with autoexpect and then edited, there is some more stuff in the file autoexpect spit out.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.