in reply to Re^3: Perl Expect
in thread Perl Expect
nicetelnet is just a wrapper on top of telnet. reposing the code.
#!/usr/bin/perl use strict; use Expect; my $session = new Expect; $session->spawn("telnet $my_ip"); $session->expect(90, -re, "login:"); print $session "regress\r"; $session->expect(90, -re, "Password:"); print $session "MaRtInI\r"; $session->expect(90, -re, ".*"); print $session "pwd\r"; $session->expect(90, -re, ".*"); $session->close()
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Perl Expect
by salva (Canon) on Jan 18, 2018 at 07:39 UTC |