Expect a command with and without confirmation



How to Expect this with a generic proc to handle some commands that
require confirmation and some don't?

System prompt is ">"

Scenario 1 (no confirmation for the command)
cmd_no_confirm
....
some outputs


Scenario 2 (confirmation required)
cmd_needs_confirm
Are you sure?
Y
....
some outputs


I tried this and it didn't work:
set $cmd "some command"
exp_send cmd\r
expect {
-re "Are you sure?\\r\\n> " { ## regexp didn't pick up this!!
exp_send Y\r ## is it OK to send here
exp_continue ## and back to the Expect loop?
}
> { # we are done }
timeout { # no good }
}

Thanks for any help and suggestion.

/Why Tea

.



Relevant Pages

  • Re: Complex form popup problem: warning...longwinded
    ... command button that launched the other form. ... main form that allows the user to fill out the scenario information, ... The majority of the fields in the query that are the recordsource of the ... remainder belong to the new record that was programmatically saved. ...
    (microsoft.public.access.formscoding)
  • Re: How to Get Command Line Arguments of a Newly Created Process:
    ... If i call NtQueryInformationProcessthen would it get me to command ... line arguments which i know are present in PEB? ... If yes then why its not returning success ... SCenario One: ...
    (microsoft.public.win32.programmer.kernel)
  • Re: sliced find in Linq
    ... Temptables are dropped at the connection closing statement. ... be right after the command, but it can also be that there will be other ... Depends on the scenario, so very hard to write a generic ... My .NET blog: http://weblogs.asp.net/fbouma ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Youre Not Going To Believe This: Another Cirrus Is Down (Statesville, NC)
    ... Kobayashi Maru scenario ... See Kobayashi Maru for related links. ... and command capabilities when facing an impossible situation. ... Kirk took the test a third time after surreptitiously reprogramming the ...
    (rec.aviation.piloting)
  • Re: disable buttons when printing an asp page
    ... please follow up in an HTML or CSS ... > just print the confirmation page minus the command buttons and the URL's ...
    (microsoft.public.inetserver.asp.general)