Wednesday, March 17, 2010

What can you Expect?

I was playing around with a UNIX command line tool called Expect.  It is used for handling interactive sessions, which can occasionally come in handy for using some telnet like applications.

For myself, I'm lazy, and hate to memorize all these different configurations and such, so I created this:
#!/usr/bin/expect

set USER "hsolo"
set SRVR "falcon.server.net"
set PSWD "secret"

spawn ssh $USER@$SRVR
expect "Password: "
send "$PSWD
"

interact

No comments:

Post a Comment