[Ssh-sftp-perl-users] register_handler with shell ??
Brought to you by:
dbrobins
|
From: Michael G. <mic...@pa...> - 2005-10-06 20:16:29
|
Hello,
I am trying to write a scipt that will connect using SSH and be used
interactively. I would also like to be able to use register_handler ?
My script below only works with $ssh->cmd and not $ssh->shell
$ssh->register_handler(SSH_SMSG_STDOUT_DATA, sub {
my ($ssh,$packet) = @_;
my $str = $packet->get_str;
print "\nFOUND: ",$str;
});
##
eval "use Term::ReadKey;";
ReadMode('raw');
eval "END { ReadMode('restore') };";
#$ssh->cmd('ls');
$ssh->shell;
print "Connection to $host closed.\n";
Michael
|