in reply to How do I send a password to a command I start with Perl's Expect.pm

How do I send a password to a command I start with Perl's Expect.pm

$exp->send("string\n");

Of course, you haven't started any commands with Expect, so that's a very odd question to ask.

I'm not allowed to install another module(politics/not rights).

So if I post my code here, you can use it, but if I post on it on CPAN, you can't? That doesn't make any sense. Perhaps you could clarify why you think you can't install a module.

If it's any of the above, address the issue and install Net::SSH::Expect. If not, then maybe it's one of the following:

These lists are far from exhaustive. If your situation doesn't match, let me know what the situation is.

  • Comment on Re: How do I send a password to a command I start with Perl's Expect.pm
  • Download Code

Replies are listed 'Best First'.
Re^2: How do I send a password to a command I start with Perl's Expect.pm
by Anonymous Monk on Oct 23, 2010 at 02:00 UTC
    *) I don't have root permission, off course it needs privilege permission beyond a simple user.
    *) This server don't have access to internet so (cpanm,local::lib,perlbrew) and installing Net::SSH::Expect isn't possible.

      off course it needs privilege permission beyond a simple user.

      Simple users can install modules. Like I said, you don't need special permissions to install a module. You can install modules into any directory.

      This server don't have access to internet

      Whatever means you use to place your script on the server can also be used to place the script known as the Net::SSH::Expect module.