[Tutor] Capture telnet output to a file?
dpotter at nc.rr.com
dpotter at nc.rr.com
Mon Oct 16 20:19:26 CEST 2006
I was not aware of script. Thanks!
----- Original Message -----
From: Bill Campbell <bill at celestial.net>
Date: Monday, October 16, 2006 1:55 pm
Subject: Re: [Tutor] Capture telnet output to a file?
To: tutor at python.org
> On Mon, Oct 16, 2006, dpotter at nc.rr.com wrote:
> >Hello,
> >
> >I am trying to capture telnet output to a file. For example I
> want to
> >telnet into a router and run the command ?show arp? and be able to
> >capture all the arp information that normally would show up on the
> >screen to a file on my system. I am using python and pexpect to
> >backup my router configurations on a daily basis, but for this the
> >router has the option to send the configuration via tftp to a server,
> >there is no option to send normal screen data to a file. Any ideas?
>
> One could use the ``script'' program in *NIX systems which
> captures your entire session.
>
> I haven't used pexpect with python yet, but the perl expect
> module can also be used to capture things like this, and I would
> expect that one could do this with pexpect as well.
>
> Bill
> --
> INTERNET: bill at Celestial.COM Bill Campbell; Celestial Software LLC
> URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
> FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206)
> 236-1676
>
> ``If the personal freedoms guaranteed by the Constitution inhibit the
> government's ability to govern the people, we should look to limit
> thoseguarantees.''
> -President Bill Clinton, August 12, 1993
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
More information about the Tutor
mailing list