in reply to Need help on expect
Disclaimer: Without having the actual program to interact with, the following is only based on a simplified test. Also, I assume that the program's prompts are as shown in the regular expressions (with the exception of \s+ instead of \\s+).
Another problem is that the second "Enter pack name" regex, qr/Enter pack name \(or q\) \[q\]: \(q\)\s+/, will never match, because the first "Enter pack name" regex, qr/Enter pack name \(or q\) \[q\]:\s+/ will always match first. So one possible solution is to move the second regex before the first.
Or, you could remove the second "Enter pack name" regex, and apply either of the two solutions given above (1, 2), they do seem to work under the assumptions given above.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need help on expect
by toaravind (Initiate) on Feb 22, 2015 at 04:57 UTC | |
by Anonymous Monk on Feb 23, 2015 at 15:44 UTC | |
by toaravind (Initiate) on Feb 25, 2015 at 08:43 UTC |