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 $_; }
In reply to Correct way to use Net:SSH2 module by MikeKulls2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |