pexpect module

Gianluca Trombetta gianluca.trombetta at tin.it
Mon May 17 12:13:16 EDT 2004


hmmm, i'm not so stupid...:-).
The command ls -l | more was an example...i'm not really need to run ls -l |
more in an automate program.
But I need to run some cisco commands like "show ip bgp summary", this
command print a table and put a "More" by default, if the table is too big
for a single terminal screen.
So I need to remove this behavior because if I match the " --More-- " with
expect module i can match only the first one "More", then this the program
crash and receives a timeout.

Hi
Gianluca



"Lee Harr" <missive at frontiernet.net> ha scritto nel messaggio
news:P9Lpc.5055$xg3.4383 at news01.roc.ny...
> On 2004-05-14, Gianluca Trombetta <gianluca.trombetta at tin.it> wrote:
> > Someone know pexpect module?
> > I've a problem working with it...
> >
> > I need to run some commands on remote hosts, like ls, df -k etc..All
right.
> > Although, when i launch a command that have a "more" inside, i don't
know
> > what i must expect!
> > An example:
> >
> > if i want to run an "ls -l | more" on a remote host, it don't return me
a
> > prompt, but a "-------------More-------------"...thus i don't know how
much
> > this.
> >
>
>
> The only reason I can see for piping the command through more would
> be if there were a person sitting there wanting to read the output
> before going on to read the next page of output.  That seems counter
> to the idea of using pexpect to automate the process. Do you
> really need to pipe through more?
>
> -- 
> http://mail.python.org/mailman/listinfo/python-list
>







More information about the Python-list mailing list