#!/usr/bin/expect -f spawn telnet localhost 4240 expect ">" send "enable\r" expect "#" send "show ns\r" expect "#" send "exit\r" expect "#"