Cover V08, I03
Article
Listing 1
Listing 2
Listing 3
Listing 4

mar99.tar


Listing 1: A simple Expect script

#!/usr/bin/expect -
spawn telnet (hostname or your router's IP address here)
expect "word: " {send "(your vty password)\r"}
expect "(router's prompt)" {send "enable\r"}
expect "word: " {send "(your enable password)\r"}
expect "(router's configuration prompt)" {send "configure terminal\r"}
send "(one line of the configuration)\r"
send "(yet another line of the configuration)\r"
send "exit\r"
close

# End of File