[Fwd: Re: Net::SSH2::Channel->exec, grabbing stdout]

[Fwd: Re: Net::SSH2::Channel->exec, grabbing stdout]

am 18.06.2008 15:39:22 von listmail

I just tested against a remote linux server and it worked. I'll have to
address this on the Solaris 10
server(s), probably the custom rolled sshd installation/config. Thanks
for the assist.

-------- Original Message --------
Subject: Re: Net::SSH2::Channel->exec, grabbing stdout
Date: Wed, 18 Jun 2008 09:12:10 -0400
From: listmail
To: Bill Luebkert
CC: activeperl@listserv.activestate.com
References: <4857DB9A.5090008@triad.rr.com>
<4858F7C6.7010603@roadrunner.com>



$Bill :)

Are you using the http://theoryx5.uwinnipeg.ca/ppms/ repo, Net::SSH2
0.09 version? I'm guessing the libssh2 dependency is satisfied in
perhaps the SSH2.dll? At least I hope things get installed correctly
via ppm. Anyway, I've tried several valid commands such as '/bin/df
-k', 'ls', and your suggestions with no success on retrieving output.
I've also tried the suggestions at
http://www.perlmonks.org/?node_id=621761 which lean towards using
shell() with no luck.


Bill Luebkert wrote:
> listmail wrote:
>> I've just started testing Net::SSH2 in hopes to eventually replace
>> Net::SSH[::W32Perl].
>> I am having trouble retrieving the stdout data from channel->exec. I
>> do not require an
>> interactive shell, just an ability to execute commands and retrieve
>> the stdout + statuses.
>> Is there something I am missing or do I need to do something
>> different altogether?
>
>
>> my $chan = $ssh2->channel();
>> $chan->blocking(0);
>>
>> my $returnval = $chan->exec('who') or die "Couldn't exec
>> 'who'\n";
>
> Try several other commands besides who - like 'ls -lF' for eg.
> Or try 'who --help' and see if that generates usage text.
> Also try dropping the non-blocking.


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs