Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Perl Programming Language

how to automate userinteractive prompt


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.

On May 24, 10:01 am, king <hara.acha@gmail.com> wrote:

> How to do the user interactive prompt automated using perl.

http://search.cpan.org/~rgiersig/Expect-1.20/Expect.pod
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.

On May 25, 10:45 am, king <hara.acha@gmail.com> wrote:

> Paul Lalli wrote:
> > On May 24, 10:01 am, king <hara.acha@gmail.com> wrote:

> > > How to do the user interactive prompt automated using perl.

> >http://search.cpan.org/~rgiersig/Expect-1.20/Expect.pod
> 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

king wrote:
> 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.

http://search.cpan.org/~smueller/PAR-0.973/lib/PAR.pm
Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc