Scrolling through text while interacting with program prompts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Scrolling through text while interacting with program prompts
# 1  
Old 01-02-2013
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:

Code:
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!

Last edited by jim mcnamara; 01-02-2013 at 11:18 PM..
# 2  
Old 01-03-2013
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?
# 3  
Old 01-03-2013
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): [?]"
# 4  
Old 01-03-2013
Have you tried with expect?

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

Regards
# 5  
Old 01-03-2013
Thanks, expect worked like a charm! I used something like:

Code:
/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

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Code for count the frequency of interacting pairs

Hi all, I am trying to analyze my data, and I will need your experience. I have some files with the below format: res1 = TYR res2 = ASN res1 = ASP res2 = SER res1 = TYR res2 = ASN res1 = THR res2 = LYS res1 = THR res2 = TYR etc (many lines) I am... (3 Replies)
Discussion started by: Tzole
3 Replies

2. Shell Programming and Scripting

Bash script to start program and answer prompts?

I'm trying to write a script the simplifies the execution of a program: After starting the program (sh ~/.mfix/model/make_mfix) I am prompted four times for options: Do you need SMP version? (y/n) Do you need DMP version? (y/n) Do you need debug version? (y/n) Force re-compilation of... (2 Replies)
Discussion started by: lanew
2 Replies

3. Shell Programming and Scripting

ssh foo.com sudo command - Prompts for sudo password as visible text. Help?

I am writing a BASH script to update a webserver and then restart Apache. It looks basically like this: #!/bin/bash rsync /path/on/local/machine/ foo.com:path/on/remote/machine/ ssh foo.com sudo /etc/init.d/apache2 reloadrsync and ssh don't prompt for a password, because I have DSA encryption... (9 Replies)
Discussion started by: fluoborate
9 Replies

4. Shell Programming and Scripting

Passing text to RCS prompts in KORN script,

Hopefully someone can help here. I have a script written in korn by a former employee and I am trying modify it. Most of the script works except when we run it and pass the tesxt 'unlock' as a parameter when we want to unlock a file in RCS (revision control system). When we run this script and use... (2 Replies)
Discussion started by: pjones0066
2 Replies

5. Shell Programming and Scripting

supply password to scp with out interacting

Hi, I am trying to supply password to scp with out having manual interaction. Like, store the password in a variable and it should be supplied to the scp when it prompted for the password. Is there any other way than the user authentication and using "expect" in perl script. i.e is this... (3 Replies)
Discussion started by: pc_raghu
3 Replies

6. Shell Programming and Scripting

Interacting with two BASH shells

Hi. I'm working with two BASH shells in order to perform two tasks. For simplicity, suppose that at Shell #1 I'm executing this program: sleep 100 whose PID is 263. Meanwhile Shell #2 is waiting for its termination to follow with a second one. I tried with: wait 263 # Script for second... (4 Replies)
Discussion started by: hresquivelo
4 Replies

7. UNIX for Dummies Questions & Answers

Scrolling text continued

Perderabo * Unix Daemon * Join Date: Aug 2001 Location: Ashburn, Virginia Posts: 9,071 Using head and tail like that is terribly inefficient. I decided to try a rewrite. Sheesh...I spent all morning on this.... Code: #! /usr/bin/ksh # # scroller --- display text, but sleep every... (0 Replies)
Discussion started by: jamesapp
0 Replies

8. Shell Programming and Scripting

Shell Program that prompts for user Id

Hi I have a question that after trying tirelessly I cant solve. I'm not great wth UNIX and wonder if anyone could help. I have to create a shell program using functions that prompts for a user ID. I must then verify that the user Id corresponds to an account on the system. If a legal user Id is... (16 Replies)
Discussion started by: mmg2711
16 Replies

9. UNIX for Dummies Questions & Answers

Shell Program that prompts for user Id

Hi I have a question that after trying tirelessly I cant solve. I'm not great wth UNIX and wonder if anyone could help. I have to create a shell program using functions that prompts for a user ID. I must then verify that the user Id corresponds to an account on the system. If a legal user Id is... (1 Reply)
Discussion started by: mmg2711
1 Replies
Login or Register to Ask a Question