How to send a password with special characters by using Expect module?

969 views Asked by At

I have a big problem with special characters of Perl.

I'm trying to establish a Telnet connection.

So, after the command "Telnet $ipAddress" I have to send the credentials.

I have done this way:

my $exp = new Expect;

$exp->send("username");
$exp->send("@password");

The problem is that my password has the @ character as first character and it is a special character.

I have already tried with '@password', "\@password" or "\\@password", but the login fails.

How can I get my password to work?

0

There are 0 answers