Hi,
total noobian here: trying to right an expect script to log-in to a router with ssh and retrieve some stats to a log file, however i seem to loose the output passed the password stage.
I relaise there is a fair ammount online regarding this, and apologies for covering old ground, but i seem to be totally failing to get my head around it thus i was hoping someone could spell it out.
Here is the code i am using so far:
#!/usr/bin/expect
spawn ssh -p1022 SUPERUSER@x.x.x.x
expect "SUPERUSER@192.168.128.2'2 password:"
send "XXXXX\r"
send "rept-opstat-pon:
on-1-1-1-2:::noreset;\r"
send ^C
and the output i get is:
spawn ssh -p 1022 SUPERUSER@x.x.x.x
SUPERUSER@x.x.x.x's password:
I have experimented with expect_out and exp_send to no avail.
Any help would be great.
Thanks in advance.
Rob