Expect Not Showning Spawned instance Output
I'm trying to automate a SSH connection to a device and retrieve a status periodically. My script appears to run, I get logged on to the device and and the commands appear to run. The problem is I'm not seeing any of the output from the commands. I've tried expect_user, expect_tty and tried some redirection, tried writing the expect buffer to a file but nothing. Below is the script. Any suggestions would be appreciated.
spawn ssh -t username@devicename
send "show ospf neighbor\r"
send "show route next-hop xx.yy.zz.aa"
When I run the script it spawns the ssh and displays the spawn line, then the password, on the next line it shows the "show ospf neighbor" command and the "show route next-hop" command and finally "exit" and I get the shell prompt back.
I would like to see or at least save the output from the commands.