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

Z

z0mb1e_fr

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
 
B

Bill

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?
 
Z

z0mb1e_fr

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top