1 # $Id: connect-test.e,v 1.1 2002/09/09 10:16:24 alex Exp $ 2 3 spawn telnet localhost 6789 4 expect { 5 timeout { exit 1 } 6 "Connected" 7 } 8 9 send "oper\r" 10 expect { 11 timeout { exit 1 } 12 "451" 13 } 14 15 send "quit\r" 16 expect { 17 timeout { exit 1 } 18 "Connection closed" 19 } 20 21 # -eof-