in reply to Re: SSH OUTPUT WITHOUT ENDING OF COMMAND
in thread SSH OUTPUT WITHOUT ENDING OF COMMAND

Ohh ...I did not mention that I am calling from perl script... using NET::SSH::PERL so its fairly simple the shell script which i want to run is 'snap.sh', which itself calls lots of stuff and gives the output/status of those one by one.. so I want the same thing to be seen on my server where I am running perl script as the shell script is running...
  • Comment on Re^2: SSH OUTPUT WITHOUT ENDING OF COMMAND

Replies are listed 'Best First'.
Re^3: SSH OUTPUT WITHOUT ENDING OF COMMAND
by salva (Canon) on Dec 09, 2010 at 07:04 UTC
    If you are on a Linux/Unix system, you can use Net::OpenSSH:
    use Net::OpenSSH; my $ssh = Net::OpenSSH->new('foo@host'); $ssh->error and die "unable to connect: " . $ssh->error; my $pipe = $ssh->pipe_out("snap.sh"); while(<$pipe>) { print $_; }