Loading ...
Sorry, an error occurred while loading the content.

Re: [TwinCLinG] [perl ] How to capture the command prompt.

Expand Messages
  • Bharathi Subramanian
    ... Every program will return some status at the end its execution. So you have to check the return value of the rsh program. Read more about system() call.
    Message 1 of 7 , Oct 11, 2009
    • 0 Attachment
      > But for some host ssh is not configured and we can get uptime using
      > the rsh. So what i have done is i have set a alarm for
      > disconnecting the hosts where ssh is not working.

      Every program will return some status at the end its execution. So
      you have to check the return value of the rsh program. Read more
      about system() call.

      Bye :)
      --
      Bharathi S
    • shinoj vg
      what about net::rsh ? Regards, Shinoj. ... _________________________________________________________________ News, views and inimitable perspectives – On MSN
      Message 2 of 7 , Oct 12, 2009
      • 0 Attachment
        what about net::rsh ?

        Regards,
        Shinoj.



        > To: ilughyd@yahoogroups.com
        > From: rhce.san@...
        > Date: Sat, 10 Oct 2009 12:56:52 +0000
        > Subject: [TwinCLinG] [perl ] How to capture the command prompt.
        >
        > Hi All,
        >
        > I have a small doubt in perl.
        >
        > I am running the following command:
        >
        > rsh xyz uptime
        > root@xyz password:
        >
        > The command is prompting for password , I want to capture "password" line. Is there any regular expression or way to do it.
        >
        > Thanks,
        > Santosh
        >
        >
        >
        >
        > ------------------------------------
        >
        > -----------------------------------------------
        > Next Meeting as on our Website: http://ilughyd.org.in
        > -----------------------------------------------Yahoo! Groups Links
        >
        >
        >

        _________________________________________________________________
        News, views and inimitable perspectives � On MSN India, you get an all-round view of things that matter.
        http://in.msn.com

        [Non-text portions of this message have been removed]
      • Premson Rodriguez
        You mean something like this: $exp- expect(15, -re , qr/((Password :)|(Password : ))/i)) ? (print Entering Password n ) : (die [$host3] - ERR: Error with
        Message 3 of 7 , Oct 18, 2009
        • 0 Attachment
          You mean something like this:

          $exp->expect(15, '-re', qr/((Password\:)|(Password\:\ ))/i)) ? (print "Entering Password\n") : (die "[$host3] - ERR: Error with sending password for ($user1)\n");

          The above snippet is for Expect.

          Premson.



          --- On Sun, 11/10/09, santosh kumar <rhce.san@...> wrote:

          From: santosh kumar <rhce.san@...>
          Subject: Re: [TwinCLinG] [perl ] How to capture the command prompt.
          To: ilughyd@yahoogroups.com
          Date: Sunday, 11 October, 2009, 9:43 AM

          Bharathi,

          i actually want to capture the line "password" , i dont want to send any
          password.
          My requirement is not to send any password , i have to say that whole line
          in one variable of short.

          I tried expect.pm but it doesn't help my cause. Any other suggestions ?

          Thanks,
          Santosh

          On Sat, Oct 10, 2009 at 11:22 PM, Bharathi Subramanian <
          sbharathi@...> wrote:

          >
          >
          > > The command is prompting for password , I want to capture "password"
          > > line. Is there any regular expression or way to do it.
          >
          > If you are looking for Expect like tool, search for "expect.pm"
          >
          > Bye :)
          > --
          > Bharathi S




          Yahoo! India has a new look. Take a sneak peek http://in.yahoo.com/trynew

          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.