Re: Re: [Ssh-sftp-perl-users] want to get rid of IO::Socket::INET messages.
Brought to you by:
dbrobins
From: Ajit <aji...@re...> - 2006-04-20 13:44:56
|
Hi Matthew,=0AI made changes suggested by you ,=0Abut it is still giving me= these unwanted messages.=0A=0AI tryed following things ,=0A=0Amy($stdout, = $stderr, $exit) =3D $ssh->cmd($cmd);=0Aprint $stdout;=0A=0AAs well as ( jus= t to try )=0A =0Amy(@stdout, @stderr, $exit) =3D $ssh->cmd($cmd);=0Aprint @= stdout; =0A=0AThanks=0A~ajit=0A=0A=0AOn Thu, 20 Apr 2006 Matthew J.Salerno = wrote :=0A>--- Ajit <aji...@re...> wrote:=0A>=0A> > Hi Guys,=0A= > > I have written a small perl script=0A> >=0A> > #!/usr/bin/perl=0A> > us= e strict;=0A> > use Net::SSH::w32Perl;=0A> > use Net::SSH::Perl;=0A> >=0A> = > my $user =3D "root";=0A> > my $pass =3D "password";=0A> > my $host =3D "1= 92.168.0.123";=0A> > my $cmd =3D "ls -lt";=0A> > my $ssh =3D Net::SSH::W32P= erl->new($host);=0A> >=0A> > $ssh->login($user, $pass);=0A> > my @test =3D = $ssh->cmd($cmd);=0A> > print @test;=0A> >=0A> >=0A> > The script when execu= ted gives desired output ,=0A> > but it gives some additional messages befo= re giving=0A> > proper output=0A> > these messages are as follows ,=0A> >= =0A> > IO::Socket::INET at=0A> > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line= 295=0A> > IO::Socket::INET at=0A> > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm = line 295=0A> > IO::Socket::INET at=0A> > C:/Perl/site/lib/Net/SSH/Perl/SSH2= .pm line 295=0A> > IO::Socket::INET at=0A> > C:/Perl/site/lib/Net/SSH/Perl/= SSH2.pm line 295=0A> > IO::String at=0A> > C:/Perl/site/lib/Net/SSH/Perl/Ch= annel.pm line 110=0A> > IO::Socket::INET at=0A> > C:/Perl/site/lib/Net/SSH/= Perl/SSH2.pm line 295=0A> > IO::String at=0A> > C:/Perl/site/lib/Net/SSH/Pe= rl/Channel.pm line 110=0A> > IO::Socket::INET at=0A> > C:/Perl/site/lib/Net= /SSH/Perl/SSH2.pm line 295=0A> > IO::String at=0A> > C:/Perl/site/lib/Net/S= SH/Perl/Channel.pm line 110=0A> > IO::String at=0A> > C:/Perl/site/lib/Net/= SSH/Perl/Channel.pm line 118=0A> > IO::Socket::INET at=0A> > C:/Perl/site/l= ib/Net/SSH/Perl/SSH2.pm line 295=0A> > IO::String at=0A> > C:/Perl/site/lib= /Net/SSH/Perl/Channel.pm line 110=0A> > IO::Socket::INET at=0A> > C:/Perl/s= ite/lib/Net/SSH/Perl/SSH2.pm line 295=0A> > total 9250=0A> > dr-xr-xr-x 52= root root 63168 Apr 20=0A> > 15:56 proc=0A> > drwxrwxrwt 4 roo= t sys 249 Apr 20=0A> > 15:55 tmp=0A> > drwxr-xr-x 17 root = sys 4096 Apr 20=0A> > 11:00 dev=0A> > -rw-r--r-- 1 root root= 13770 Apr 20=0A> > 11:00 buildsanity=0A> > dr-xr-xr-x 6 root r= oot 512 Apr 13=0A> > 14:05 vol=0A> > drwxr-xr-x 75 root sys = 4096 Apr 13=0A> > 14:05 etc=0A> > dr-xr-xr-x 1 root root = 1 Apr 13=0A> > 14:05 home=0A> > dr-xr-xr-x 1 root root = 1 Apr 13=0A> > 14:05 net=0A> > drwxr-xr-x 2 root sys 512 Apr= 13=0A> > 14:03 devices=0A> > drwxr-xr-x 2 root root 512 Apr = 5=0A> > 15:43 Documents=0A> > drwxr-xr-x 40 root sys 1024 Mar= 30=0A> > 11:24 usr=0A> > drwxr-xr-x 8 14478 staff 512 Mar 23= =0A> > 16:20 opt=0A> > drwxr-xr-x 6 root root 512 Mar 21=0A> = > 16:55 cdrom=0A> > -rw-r--r-- 1 root root 26 Mar 20=0A> > 1= 4:52 sdm=0A> > drwxr-xr-x 2 root root 512 Mar 20=0A> > 14:11 = Desktop=0A> > -rw-rw-r-- 1 root gsm 68624 Mar 3=0A> > 19:44 M= essage.log=0A> > drwxr-xr-x 11 root sys 512 Mar 2=0A> > 15:2= 7 mnt=0A> > -rwxr-xr-x 1 root root 607744 Feb 23=0A> > 13:27 ssh= .tar=0A> > -rwxr-xr-x 1 root root 93184 Feb 23=0A> > 12:45 tar.= sh=0A> > drwxr-xr-x 2 root root 512 Feb 23=0A> > 11:16 TT_DB= =0A> > drwxr-xr-x 41 root sys 1024 Feb 23=0A> > 11:12 var=0A> = > drwxr-xr-x 7 root bin 5120 Feb 23=0A> > 10:53 lib=0A> > drw= xr-xr-x 14 root sys 512 Feb 22=0A> > 19:12 kernel=0A> > drwxr= -xr-x 2 root sys 1024 Feb 22=0A> > 19:06 sbin=0A> > drwxr-xr-= x 33 root sys 1024 Feb 22=0A> > 18:38 platform=0A> > drwxr-xr-= x 4 root root 512 Feb 22=0A> > 18:38 system=0A> > lrwxrwxrwx = 1 root root 9 Feb 22=0A> > 18:38 bin -> ./usr/bin=0A> > drw= xr-xr-x 3 root sys 512 Feb 22=0A> > 18:37 export=0A> > drwx-= -x--x 2 root root 8192 Feb 22=0A> > 18:37 lost+found=0A> > 0= =0A> >=0A> > How can i overcome these additional messages and=0A> > "0" af= ter my desired output.=0A> >=0A> > Thanks=0A> > ~ajit=0A> >=0A>=0A>=0A>The = 0 that gets printed at the end is the exit code of=0A>the command you are e= xecuting.=0A>=0A>Change:=0A>my @test =3D $ssh->cmd($cmd);=0A>print @test;= =0A>=0A>To:=0A>my($stdout, $stderr, $exit) =3D $ssh->cmd($cmd);=0A>print $s= tdout;=0A>=0A>What version of Net::SSH::Perl are you using?=0A>=0A>=0A>=0A>= __________________________________________________=0A>Do You Yahoo!?=0A>Tir= ed of spam? Yahoo! Mail has the best spam protection around=0A>http://mail= .yahoo.com=0A=0A=0AMobile :- 9890671707=0D=0A=0D=0A"Success is not the resu= lt of spontaneous combustion. You must set yourself on fire." =0D=0A=0D=0A |