How to use "expect" within a Perl Script - TechRepublic
General discussion
November 18, 2002 at 10:52 PM
jamesg419

How to use “expect” within a Perl Script

by jamesg419 . Updated 21 years, 2 months ago

I’m using ‘expect’ within a perl script and I’m expecting “More…” from a router then send “\r” to proceed with next listing of data but cannot seem to get this part of the code to work.
Can anyone help!!!!!!
e.g.

#!/usr/local/bin/perl
#!/usr/local/bin/expect

variable declaration and statement……

# Inbound Frames Discarded

@lines = $sparky->cmd(“next pport.2.2.18”);
sleep $cmd_wait;
sleep $cmd_wait;
expect “More…”;
send “\r”;
print OSWITCH “\n …etc

Please….

Cliff

This discussion is locked

All Comments