Automator has asked for the wisdom of the Perl Monks concerning the following question:
Ok, Im trying to run a program on another server using Net::SSH::Perl. This program requires input, I have no trouble running simple commands like "ls -lah /blah/". Is there a way to provide Net::SSH::Perl with the input the program is going to need.
For example I might run the program getInfo.pl which prompts for the following information:
Whats your first name:
Whats your middle name:
Whats your last name:
Does anyone know how to do this, my code is below.
use Net::SSH::Perl; my $user = "testuser"; my $pass = "testpass"; my $ssh = Net::SSH::Perl->new("10.10.10.10"); $ssh->login($user,$pass); $cmd = "getInfo.pl"; ($out, $err, $exit) = $ssh->cmd($cmd); print $out;
20031228 Edit by Corion: Added formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trouble with Net::SSH::Perl
by duct_tape (Hermit) on Dec 28, 2003 at 18:44 UTC | |
|
Re: Trouble with Net::SSH::Perl
by jcpunk (Friar) on Dec 29, 2003 at 03:16 UTC |