Scrolling through text while interacting with program prompts

Hi all,

I am trying write a shell script to automate the installation of a program, but during the process of the installation, the installation program requires the user to scroll through 10 pages of a license agreement. Since this is coming from stdout and is not a prompt, I am unable to send the space keys to scroll through all of the text to get to the next prompt. Right now I have something like this:

sh ./(installation program) <<EOD
yes
(here I want to scroll through the license agreement to get to the next prompt)
yes
etc
EOD

Has anyone done anything like this? Any help would be much appreciated!

Not clear. How is the text displayed (cat/echo/more/less/binary prog)? Did you try to redirect the license agreement's output? Did you try to temporarily increase the process' (terminal) LINES variable?

I'm not exactly sure of how the text is being displayed, whether its from echo, etc. I just know its from the linux End User License Agreement interface that requires the user to scroll through the agreement before being able to get to the prompt to accept the agreement.

I see something like this:

"--(Vendor) EULA-- (0%)[Press space to continue, 'q' to quit.]"

and must press "space" multiple times to scroll through 100% of the agreement text before finally getting to the prompt:

"I have read and accept the terms of the agreement (yes/no): [?]"

Have you tried with expect?

like

http://www2.lib.uchicago.edu/keith/tcl-course/topics/expect.html

Regards

Thanks, expect worked like a charm! I used something like:

/usr/bin/expect <<EOD

set timeout 100

spawn (process)
expect "yes/no"
send "yes\r"
expect "Enter"
send "\r"
expect "0%"
send " "
expect "13%"
send " "
#etc...
EOD