how to automate userinteractive prompt

K

king

I am running a find command and the o/p i am saving in a file. The
content of the file is as bellow.

/opt/home/121/UnixAgent/bin/agent_uninstall
/opt/var/122/UnixAgent/bin/agent_uninstall
/opt/home/123/UnixAgent/bin/agent_uninstall
cannot open /proc/19364: No such file or directory
cannot open /proc/19317: No such file or directory
cannot open /proc/19365: No such file or directory
cannot open /proc/19355: No such file or directory
cannot open /proc/19342: No such file or directory
/opt/home/124/UnixAgent/bin/agent_uninstall

I need to run all agent_uninstall scripts like this.

system ("/opt/home/121/UnixAgent/bin/agent_uninstall");

when I will run this script I will get two interactive prompts where I
need to give two inputs

one is "/opt/home/121"

and the otherone is "y"

so I will have to extract all these /opt/home/121, /opt/home/124, /opt/
var/122 and give as input
after running the uninstall script.


How to do the user interactive prompt automated using perl.
And how to save all the /opt/home/121, /opt/home/124, /opt/var/122 in
a array and give then as input.
 
K

king

Thanks for the info.

I agree but I don't want to use expect because expect doesn't come by
default with all the unix machines. To make this work we have to
install expect.

Is there any other direct way to automate the userinteractive thing.

Thanks in advance.
 
P

Paul Lalli

I agree but I don't want to use expect because expect doesn't
come by default with all the unix machines. To make this work
we have to install expect.

Yeah, and? Aren't you going to have to install your script too?
What's the difference?
Is there any other direct way to automate the userinteractive
thing.

"How do I make this nail go into this piece of wood?"
"Use a hammer."
"Thanks, but we don't want to use a hammer. Is there any other way?"
"Sure, punch it repeatedly with a very strong fist. You may wish to
stock up on gauze and medical tape first though."

Same concept. If you don't want to use the right solution for the
job, feel free to do a manual solution. Have fun coding it.

Paul Lalli
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top