in reply to Re: Expect problems
in thread Expect problems

In the original code you were looking for the same pattern twice. You were probably thinking that the first time expect sees the prompt it would match the first case and that second time expect sees the prompt it would match the second case.

This would not work. You need to, within one case, check to see how many times you have seen that prompt. Zero times? do your Apply. Seen it once before? do your save. Seen it twice before? do whatever you need to do next.

In other words keep a counter of how many times you have come across that prompt and send the appropriate response.

-imran

Replies are listed 'Best First'.
Re^3: Expect problems
by sunadmn (Curate) on Dec 18, 2005 at 22:32 UTC
    This probably going to sounds like a stupid question, but would you have a suggestion on how to keep the counter for the case matches??

    Thanks a million
    SUNADMN
    USE PERL