From: Brian R. J. <scu...@ea...> - 2001-01-03 01:43:35
|
I've been trying to get the example remote login script from the FAQ to work, and I have a different problem than the one that John Stumbles was reporting. For me, it looks like expect is ignoring the exp_continue and just exiting. I've tried it on both SunOS 5.6 and RedHat 7.0, with the same result, so it's either me being stupid or 1.10 doesn't play nice with perl 5.6.0. Here's the debug output -------------------------------------------------------------------------- ... Waiting for new data (4 seconds)... spawn id(3): new data. spawn id(3): read 76 byte(s). Red Hat Linux release 7.0 (Guinness) Kernel 2.2.16-22 on an i686 login: spawn id(3): Does `Trying 10.1.1.42...\r\r\nConnected to deepthought.alacritech.com.\r\r\012Escape character is \'^]\'.\r\r\012\r\012Red Hat Linux release 7.0 (Guinness)\r\012Kernel 2.2.16-22 on an i686\r\012login: ' match: pattern #1: -re `login: $'? YES!! Before match string: `Trying 10.1.1.42...\r\r\nConnected to deepthought.alacritech.com.\r\r\012Escape character is \'^]\'.\r\r\012\r\012Red Hat Linux release 7.0 (Guinness)\r\012Kernel 2.2.16-22 on an i686\r\012' Match string: `login: ' After match string: `' Matchlist: () Calling hook CODE(0x8338ed8)... Returning from expect successfully. spawn id(3): accumulator: `' Closing spawn id(3). test Password: Timed out waiting for an EOF from spawn id(3). spawn id(3) closed. Pid 2753 of spawn id(3) exited, Status: 1 -------------------------------------------------------------------------- Everything up to 'Password: ' happens more or less instantaneously. The rest comes after the timeout. Now I haven't done any Expect for several years, and I never touched Expect.pm before today, but I would expect that it's supposed to wait for more data rather than close id(3) isn't it? Any enlightenment would be appreciated. -- Brian R. Jones scu...@ea... Slackin when I should be workin |