How to save output expect in bash -
i trying make script save output of command show version in cisco.
i need made connection 1 server ssh connection, , have connection device.
in file out.txt, have output of first connection, ssh connection, dont know how save output of show version
#!/usr/bin/expect -f #!/bin/sh spawn ssh -l user x.x.x.x expect "login as:" expect "password:" send "password\r" expect "$\r" send "telnet nemonic\r" expect "$\r" expect "login:" send "user\r" expect "password:" send "password\r" expect "*>" send "terminal length 0\r" send "show version \r" expect "*>" set results $expect_out(buffer) set config [open out.txt w] puts $config $results close $config send "exit\r" expect eof send "\r" send "exit\r"
could me?
best regards
i solve
log_file -noappend status.txt
after command show version
thank && best regards
Comments
Post a Comment