in reply to how to send input to stdin automatically?
Many programs that read passwords do not read them from STDIN - they read keystrokes from the terminal. If CVS is one of those, then sending data to its STDIN will not help you.
But yes, you can run a program from Perl and pipe data to its STDIN...
open my $pipe, '|-', 'some-program arg1 arg2'; print {$pipe} "some data\n"; close $pipe;
If you also need to read from that program's STDOUT or STDERR, check out IPC::Open2, IPC::Open3 or System::Command.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to send input to stdin automatically?
by salva (Canon) on Dec 18, 2012 at 09:06 UTC | |
|
Re^2: how to send input to stdin automatically?
by skyworld_chen (Acolyte) on Dec 18, 2012 at 08:37 UTC |