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;}
In reply to Re^3: Net SSH problems
by PeterPeiGuo
in thread Net SSH problems
by perlinmyveins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |