473,394 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

EXPECT module, howto to perform a "new page" ?

I am writing a script to change a router config.
The config is long and the result is that the display stops with a
"--more--".

Normally we type return to go to a new line or the space bar to go to
scroll down a page.

So far I failed to simulate this behaviour with expect.

The program performs a loop with:
....
....
$router->expect($timeout, "-re" , "--More--"))
print $router "\f";
....
....

I tried "\f", "\s", "\f\r", "\r", nothing works.

How can I tell expect to strike the "space bar" ?

Thanks,

Antonin
Jul 19 '05 #1
3 4905
z0*******@yahoo.fr (z0mb1e_fr) wrote in message news:<77**************************@posting.google. com>...
I am writing a script to change a router config.
The config is long and the result is that the display stops with a
"--more--".

Normally we type return to go to a new line or the space bar to go to
scroll down a page.

So far I failed to simulate this behaviour with expect.

The program performs a loop with:
...
...
$router->expect($timeout, "-re" , "--More--"))
print $router "\f";
...
...

I tried "\f", "\s", "\f\r", "\r", nothing works.

How can I tell expect to strike the "space bar" ?


What is a space character? try typing ' '.

Why is this needed anyway? Most programs will not do the --more--
thing if they are redirected to a file--why not redirect to file and
the read the file?
Jul 19 '05 #2
wh******@lynxview.com (Bill) wrote in message news:<23**************************@posting.google. com>...
z0*******@yahoo.fr (z0mb1e_fr) wrote in message news:<77**************************@posting.google. com>...
I am writing a script to change a router config.
The config is long and the result is that the display stops with a
"--more--".

Normally we type return to go to a new line or the space bar to go to
scroll down a page.

So far I failed to simulate this behaviour with expect.

The program performs a loop with:
...
...
$router->expect($timeout, "-re" , "--More--"))
print $router "\f";
...
...

I tried "\f", "\s", "\f\r", "\r", nothing works.

How can I tell expect to strike the "space bar" ?


What is a space character? try typing ' '.

Why is this needed anyway? Most programs will not do the --more--
thing if they are redirected to a file--why not redirect to file and
the read the file?


I tried that already.
However I read line by line '\r\n' and that works fine.

Antonin
Jul 19 '05 #3
jayb
1
Or you could just issue 'terminal length 0' on the router...
Jul 29 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Edward K. Ream | last post by:
The docs for 2.2 and 2.3 contain a "What's new" section. Are there any such sections for 2.0 and 2.1? If so, where are they? Thanks. Edward...
18
by: Leslaw Bieniasz | last post by:
Cracow, 28.10.2004 Hello, I have a program that intensively allocates and deletes lots of relatively small objects, using "new" operator. The objects themselves are composed of smaller...
7
by: mrwoopey | last post by:
I have a asp.net application that uses the crystal report viewer control. It displays all of my reports but all of a sudden it started giving me the following error on ONLY two reports: "Fail...
3
by: NuB | last post by:
I have a C# web form that allows the user to perform a search if all the required fields are filled in, which works fine, my issue is if a user does a sucessfull search then enters in data and...
51
by: Tony Sinclair | last post by:
I'm just learning C#. I'm writing a program (using Visual C# 2005 on WinXP) to combine several files into one (HKSplit is a popular freeware program that does this, but it requires all input and...
2
by: Gabriele *darkbard* Farina | last post by:
Hi, I'm using Python 2.5 to develop a simple MVC framework based on mod_python. To load my controllers, I create new modules using the "new" module like this: # .... my_module =...
1
by: Jeff | last post by:
I need to place a "Previous Page" link on every page within my site and a simple javascript:history.back() will not work because I need it to capture the state of the page when I left it. For...
350
by: Lloyd Bonafide | last post by:
I followed a link to James Kanze's web site in another thread and was surprised to read this comment by a link to a GC: "I can't imagine writing C++ without it" How many of you c.l.c++'ers use...
30
by: Medvedev | last post by:
i see serveral source codes , and i found they almost only use "new" and "delete" keywords to make they object. Why should i do that , and as i know the object is going to be destroy by itself at...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.