in reply to Re^2: Net SSH problems
in thread Net SSH problems
Here is how you can do it, the key is send_eof():
use Net::SSH2; use strict; my $ssh = Net::SSH2->new(); $ssh->connect("curry") or die "Unable to connect host\n"; $ssh->auth_password("aabchts4", "doneit") or die "Failed to auth\n"; my $channel = $ssh->channel() or die "Channel creation failed\n"; $channel->exec("wc"); $channel->write("abc def\n"); $channel->write("abc def\n"); $channel->send_eof(); while (<$channel>) {print;}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Net SSH problems
by perlinmyveins (Novice) on Nov 15, 2010 at 10:09 UTC | |
|
Re^4: Net SSH problems
by perlinmyveins (Novice) on Nov 15, 2010 at 11:38 UTC |