From: Patrick B. <c.p...@gm...> - 2009-01-26 19:35:54
|
This is my first post in this forum. I am trying to automate the setup of a network device from scratch through a serial connection using a combination of minicom and perl. I initially tried using minicom's built-in runscript program to do the configuration, but found that it didn't allow me to do some things I wanted to (like opening config files and piping their contents to STDIN), so I changed minicom's setup to use perl instead. Now my problem is how to use Expect.pm. Minicomm's documentation states "Stdin and stdout are connected to the modem, stderr to the screen" I'm just trying to get the basics of interaction at this point. So far I've got: ---------------- use Expect; my $exp = new Expect; $exp->raw_pty(1); print "\n"; $exp->expect(3, "root]\#"); $exp->send("ls"); ---------------- When I add "$Expect::Exp_Internal = 1;" to see what's happening, I get the following: ---------------- : Does `' match: pattern #1: -ex `root]#'? No. Waiting for new data (3 seconds)... TIMEOUT Returning from expect with TIMEOUT or EOF ---------------- A standard "print" command works just fine, but I can't get expect to read or write. How do I hook expect.pm to STDIN/STDOUT? Thanks, Patrick -- View this message in context: http://www.nabble.com/Using-perl-and-Expect.pm-with-minicom-tp21670581p21670581.html Sent from the Perl - Expectperl-Discuss mailing list archive at Nabble.com. |