public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] OT expect script question
@ 2018-12-05  0:28 Adam Carter
  2018-12-05  7:40 ` Gerrit Kühn
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Carter @ 2018-12-05  0:28 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

In my response matching I would like to have a catch all so if nothing
specific is matched I can take an action, but when I include the "*"
option, it is selected even if string1 matches. From the expect man page
"In the event that multiple patterns match, the one appearing first is used
to select a body." So why are actions3 getting executed when string1 is
matched? If i remove the "*" section, string1 is matched.

expect {
    "string1" { <actions1>  }
    "string2" { <actions2>  }
    "*" { <actions3> }
}

[-- Attachment #2: Type: text/html, Size: 743 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-06  2:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-05  0:28 [gentoo-user] OT expect script question Adam Carter
2018-12-05  7:40 ` Gerrit Kühn
2018-12-06  2:31   ` Adam Carter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox