Giving run time value for system command
- Hi ALL,
I want to give the input for the system command while
running the command from the Perl script .
$ /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
Never miss a thing. Make Yahoo your home page.
>>>>> "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> $ /usr/bin/passwd --stdin root
gopi> Changing password for user root.
gopi> <cursor is waiting for input >
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
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!