From: Austin S. <te...@of...> - 2002-03-15 06:39:57
|
<snip> > input none\r\012!\r\012!\r\012end\r\012 > \r\012cs3mc-lab-e0a#' > match: > pattern #1: -re `^cs3mc-lab-e0a(\\(\S+\))?#'? No. ^^ ^ Hmm, this is interesting. Two backslashes in one spot, one in the next. If you have an escaping problem the regex might fail with mismatched parens. It's not obvious from the script, but you might try changing the number of '\'s in the regex. > > Waiting for new data (4 seconds)... > TIMEOUT > > Well, there's the "\r\012cs3mc-lab-e0a#", the same thing that matched > previously. When I look at the debug output of the script when I use it, > it looks the same, except that in my environment the string is printed > as "\r\ncs3mc-lab-e0a#". > > I don't think the problem is multi-line matching - my program doesn't > touch $Expect::Multiline_Matching and if I set it to 0 it fails on the > first match try. However, the big difference between the early commands > that matched and the one that failed is that the latter produces hundreds > of lines of output, while the successful commands produced either 30-40 > lines (the "show term") or none at all (the two "set term" commands) except > for the router's prompt. > This could be a problem if your timeout isn't set high enough. Occasionally slow devices can take a while to respond, particularly if they have large numbers of interfaces attached, e.g. heavily loaded access router. Your 10 second timeout default may not be long enough in some cases, though it does seem to have gotten the correct data in this case. Austin |