This is my first post and i am bit new to python. Pls dont mind if my question is dumb, kindly guide me
I am writing a pexpect script (i am using linux Centos 5.5) to access my cisco router and want to record the output of "show version" command
This is my script
child = pexpect.spawn("ssh firstname.lastname@example.org")
Now i can see on my router that i have successfully logged in. But i dont know how to catch the output and save it to a file. I saw several examples like child.logfile = sys.stdout etc but i really dont know how to get it working.
Pls if someone has experience with pexpect, kindly help me out.
Note: I have already cached the ssh keys, so to avoid complexity.
Thanks in advance