troubleshooting Question

Using expect to install an rpm package

Avatar of atxtechie
atxtechie asked on
PerlScripting LanguagesShell Scripting
4 Comments1 Solution1246 ViewsLast Modified:
I am a QE tester attempting to automate an installation script on Redhat 5 for one of our software offerings. I am needing to run a script that shows an End-User license agreement and asks the installer to type Yes or no before continuing to install an rpm package. I am trying to use expect to complete this job. I created a script to install this package. When the script is run, the end-user needs to hit the 'q' button to get past the license information or hit space 4 times, then they need to type 'yes', after that the installer should install the package. What I am finding is that the expect script gets up to the point where the question is prompted and then it stops, nothing is installed. I am running the expect script as root. I have attached the expect script. Does anyone know what I am doing wrong?
#!/usr/local/bin/expect
 
spawn sh /home/user/DIConnectivityMain-9.2.3.64-linux.sh
expect "More"
send "q"
expect "Do you agree to the above license terms?"
send "yes\r"
ASKER CERTIFIED SOLUTION
atxtechie

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros