in reply to Re: Perl Expect
in thread Perl Expect
Please find sample code snippet: #!/usr/bin/perl use strict; use Expect; my $session = new Expect; $session->spawn("/volume/labtools/bin/nicetelnet -KE $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(); <\p>
Error: Get below error, when script tries to print "pwd\r" cmmand on the expect handle. ERROR: No such file or directory <\p> Thanks in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl Expect
by salva (Canon) on Jan 17, 2018 at 12:05 UTC | |
by Anonymous Monk on Jan 18, 2018 at 05:23 UTC | |
by salva (Canon) on Jan 18, 2018 at 07:39 UTC |