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

Giving run time value for system command

Expand Messages
  • gopi ramya
    Hi ALL, I want to give the input for the system command while running the command from the Perl script . Example: ==================================== $
    Message 1 of 2 , Nov 15, 2007
    • 0 Attachment
      Hi ALL,

      I want to give the input for the system command while
      running the command from the Perl script .


      Example:
      ====================================
      $ /usr/bin/passwd --stdin root
      Changing password for user root.
      <cursor is waiting for input >

      =============================
      I need the perl code for this.


      Please suggest way to solve this issue.

      Thanks in advance





      Thanks && Regrads
      GOPI . R
      94435 92202


      ____________________________________________________________________________________
      Never miss a thing. Make Yahoo your home page.
      http://www.yahoo.com/r/hs
    • merlyn@stonehenge.com
      ... gopi Hi ALL, gopi I want to give the input for the system command while gopi running the command from the Perl script . gopi Example: gopi
      Message 2 of 2 , Nov 15, 2007
      • 0 Attachment
        >>>>> "gopi" == gopi ramya <gopi_nath28@...> writes:

        gopi> Hi ALL,
        gopi> I want to give the input for the system command while
        gopi> running the command from the Perl script .


        gopi> Example:
        gopi> ====================================
        gopi> $ /usr/bin/passwd --stdin root
        gopi> Changing password for user root.
        gopi> <cursor is waiting for input >

        gopi> =============================
        gopi> I need the perl code for this.

        passwd is unusual in that it wants to talk to /dev/tty. You need
        to set up a pseudo TTY to deal with this. Expect.pm in the CPAN
        is one way.

        --
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
        <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
        Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
        See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
      Your message has been successfully submitted and would be delivered to recipients shortly.