MikeKulls2 has asked for the wisdom of the Perl Monks concerning the following question:
This appears to know when the reponse is complete because it returns immediately. What I want to know is how does it know? Does it look for the prompt or via some other means? What happens if the response contains what it is looking for? Will it exit early?my $ssh2 = new Net::SSH2(); $ssh2->connect('127.0.0.1') or die $!; $ssh2->auth_password('bob', 'smith'); if(!$ssh2->auth_ok()) { die $!; } my $channel = $ssh2->channel(); $channel->shell(); print $channel "ls -l\n"; while(<$channel>) { print $_; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Correct way to use Net:SSH2 module
by GrandFather (Saint) on Mar 19, 2013 at 03:19 UTC | |
by MikeKulls2 (Novice) on Mar 21, 2013 at 04:04 UTC | |
by salva (Canon) on Mar 21, 2013 at 09:30 UTC | |
by MikeKulls2 (Novice) on Mar 21, 2013 at 22:30 UTC | |
by salva (Canon) on Mar 22, 2013 at 08:11 UTC | |
| |
|
Re: Correct way to use Net:SSH2 module
by runrig (Abbot) on Mar 18, 2013 at 22:32 UTC | |
by MikeKulls2 (Novice) on Mar 18, 2013 at 23:26 UTC | |
by MikeKulls2 (Novice) on Mar 19, 2013 at 01:04 UTC |