GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Rex::Helper::SSH2::Expect(3) User Contributed Perl Documentation Rex::Helper::SSH2::Expect(3)

Rex::Helper::SSH2::Expect - An Expect like module for Net::SSH2

This is a module to have expect like features for Net::SSH2. This is the first version of this module. Please report bugs at GitHub <https://github.com/krimdomu/net-ssh2-expect>

Net::SSH2

 use Rex::Helper::SSH2::Expect;
     
 my $exp = Rex::Helper::SSH2::Expect->new($ssh2);
 $exp->spawn("passwd");
 $exp->expect($timeout, [
                  qr/Enter new UNIX password:/ => sub {
                                          my ($exp, $line) = @_;
                                          $exp->send($new_password);
                                        }
                ],
                [
                  qr/Retype new UNIX password:/ => sub {
                                          my ($exp, $line) = @_;
                                          $exp->send($new_password);
                                        }
                ],
                [
                  qr/passwd: password updated successfully/ => sub {
                                                  my ($exp, $line) = @_;
                                                  $exp->hard_close;
                                                }
                ]);

Constructor: You need to parse an connected Net::SSH2 Object.

Log on STDOUT.

Log everything to a file. $file can be a filename, a filehandle or a subRef.

Spawn $command with @parameters as parameters.

Currently only an alias to hard_close();

Stops the execution of the process.

This method controls the execution of your process.

Send a string to the running command.
2021-07-05 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.