rhymejerky has asked for the wisdom of the Perl Monks concerning the following question:
The $cmd is just a command that performs some maintenance and the $pwd is the password to start it. My problem is this code always hangs at the password. When I run the script with -d, it seems like the $cmd is not sent when I do $expect->send($cmd). It sends the cmd out after the $expect->expect(10,'-re','Enter'). I can see that in the debugger as well as the log file for this expect. Any idea what is happening? Thanks$expect = new Expect(); $expect->log_file("./res", "w"); $expect->spawn("/bin/bash"); $expect->expect(10,-re,'bash'); $expect->send($cmd); $expect->expect(10,'-re','Enter'); $expect->send($pwd);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Expect.pm problem
by tachyon (Chancellor) on Nov 25, 2004 at 03:59 UTC | |
by Anonymous Monk on Nov 25, 2004 at 18:28 UTC | |
by rhymejerky (Beadle) on Nov 29, 2004 at 18:36 UTC |