-
-
23 Jul 2011 19:42:46 UTC
- Distribution: Net-SSH2-Expect
- Module version: 0.1
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (1)
- Testers (51 / 0 / 0)
- Kwalitee
Bus factor: 0- License: perl_5
- Activity
24 month- Tools
- Download (2.15KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Net::SSH2
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Net::SSH2::Expect - An Expect like module for Net::SSH2
DESCRIPTION
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
DEPENDENCIES
SYNOPSIS
use Net::SSH2::Expect; my $exp = Net::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; }, ]);
CLASS METHODS
- new($ssh2)
-
Constructor: You need to parse an connected Net::SSH2 Object.
- spawn($command, @parameters)
-
Spawn $command with @parameters as parameters.
- soft_close()
-
Currently only an alias to hard_close();
- hard_close();
-
Stops the execution of the process.
- expect($timeout, @match_patters)
-
This method controls the execution of your process.
- send($string)
-
Send a string to the running command.
Module Install Instructions
To install Net::SSH2::Expect, copy and paste the appropriate command in to your terminal.
cpanm Net::SSH2::Expect
perl -MCPAN -e shell install Net::SSH2::Expect
For more information on module installation, please visit the detailed CPAN module installation guide.