Subject: | capture with ssh module.... :( |
Date: | Tue, 9 Sep 2008 15:38:19 -0500 |
To: | <bug-IO-Capture [...] rt.cpan.org> |
From: | "Jaiswal, Nitin" <Nitin.Jaiswal [...] sabre-holdings.com> |
use Net::SSH qw(ssh sshopen2);
use strict;
use IO::Capture::Stdout;
my $capture = IO::Capture::Stdout->new();
my $user = "root";
my $host = "plab2n01";
my $cmd = "ls -al /nofep";
$capture->start(); # STDOUT Output captured
ssh("$user\@$host", "$cmd") ;
$capture->stop();
[root@plabptl020 Automation]# uname -a
Linux plabptl020.dev.sabre.com 2.4.21-47.ELsmp #1 SMP Wed Jul 5 20:30:30
EDT 2006 x86_64 x86_64 x86_64 GNU/Linux
[root@plabptl020 Automation]# perl -v
This is perl, v5.8.0 built for x86_64-linux-thread-multi
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2002, Larry Wall
Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to
the
Internet, point your browser at http://www.perl.com/, the Perl Home
Page.
[root@plabptl020 Automation]# cat /etc/red*
cat: /etc/redhat-lsb: Is a directory
Red Hat Enterprise Linux ES release 3 (Taroon Update 8)
[root@plabptl020 Automation]#