how to automate userinteractive prompt

Discussion in 'Perl Misc' started by king, May 24, 2007.

  1. king

    king Guest

    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.
     
    king, May 24, 2007
    #1
    1. Advertising

  2. king

    Paul Lalli Guest

    Paul Lalli, May 24, 2007
    #2
    1. Advertising

  3. king

    king Guest

    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.


    Paul Lalli wrote:
    > On May 24, 10:01 am, king <> wrote:
    >
    > > How to do the user interactive prompt automated using perl.

    >
    > http://search.cpan.org/~rgiersig/Expect-1.20/Expect.pod
     
    king, May 25, 2007
    #3
  4. king

    Paul Lalli Guest

    On May 25, 10:45 am, king <> wrote:
    > Paul Lalli wrote:
    > > On May 24, 10:01 am, king <> 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
     
    Paul Lalli, May 25, 2007
    #4
  5. Simon Andrews, May 30, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Bass

    Re: Newbie - UserInteractive Property

    Daniel Bass, Jul 28, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    461
    Daniel Bass
    Jul 28, 2003
  2. Marina
    Replies:
    0
    Views:
    412
    Marina
    Jul 28, 2003
  3. nbotw

    Newbie - UserInteractive Property

    nbotw, Jul 29, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    371
    nbotw
    Jul 29, 2003
  4. KKuser

    About "UserInteractive"

    KKuser, May 26, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    397
    KKuser
    May 26, 2004
  5. Replies:
    12
    Views:
    1,898
Loading...

Share This Page