#!/usr/local/bin/expect -- # Description: connect to Libro-II, the NIST library catalog. The # script assumes ANSI terminal (works for DEC-compatible terminals, most # PC terminal emulators, X-terms etc). # # If possible change the account/password info below to match # the ones given to you by Marvin Bond. # # Author: przemek@rrdbartok.nist.gov (Przemek Klosowski) # Date: Sun, 13 Mar 1994 16:42:46 GMT log_user 0 ;# modems tend to send junk send_user ">>>> Reaching LIBRO-II computer (curry.nist.gov)...\n" send_user ">>>> Use Ctrl-C to quit.\n" spawn telnet curry.nist.gov expect_before eof exit ; # instead of putting it in every expect stmt.. set timeout 10 expect timeout {send_user "Can't connect to the LIBRO-II computer\n"; exit}\ -re "login:" send "YOUR ACCOUNT NAME HERE\n" expect timeout {send_user "Can't get response from the LIBRO-II computer\n"; exit} \ -re "Password:" send "YOUR PASSWORD HERE\n" expect timeout {send_user "Timed out waiting for prompt\n"; exit}\ -re "Please enter your terminal type" send "ANSI\n" expect timeout {send_user "Timed out waiting for prompt\n"; exit}\ -re "What would you" send "ws\n" log_user 1 ;# keep putting stuff back on screen interact \003 { puts "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nCtrl-C sent; aborting \r\n" ; exit}