pexpect module

Cameron Laird claird at lairds.com
Mon May 17 14:09:19 EDT 2004


In article <mailman.14.1084810407.6949.python-list at python.org>,
Gianluca Trombetta <gianluca.trombetta at tin.it> wrote:
>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.
			.
			.
			.
Crashing isn't good, of course.

There definitely are solutions.  They likely depend on details,
to the level that it's not enough to address Cisco commands
"like" 
  show ip ...
Instead one needs to focus on exactly which commands are in play.

While I don't have my Cisco manuals handy, I believe there's an
environment variable or command-line flag that instructs 
  show ...
to report all its results without screen formatting.  Find that,
and use *that* form of the command.  It will simplify your
pexpecting.
-- 

Cameron Laird <claird at phaseit.net>
Business:  http://www.Phaseit.net



More information about the Python-list mailing list