Gentoo Archives: gentoo-user

From: "Gerrit Kühn" <gerrit.kuehn@×××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] OT expect script question
Date: Wed, 05 Dec 2018 07:40:13
Message-Id: 20181205084000.8b4d17ba35765ec691795c66@aei.mpg.de
In Reply to: [gentoo-user] OT expect script question by Adam Carter
1 On Wed, 5 Dec 2018 11:28:55 +1100 Adam Carter <adamcarter3@×××××.com>
2 wrote about [gentoo-user] OT expect script question:
3
4 > expect {
5 > "string1" { <actions1> }
6 > "string2" { <actions2> }
7 > "*" { <actions3> }
8 > }
9
10 From
11 <https://www.oreilly.com/library/view/exploring-expect/9781565920903/ch04.html>
12
13 ---
14 expect *
15 Here the * matches anything. This is like saying, ?I don?t care what?s in
16 the input. Throw it away.? This pattern always matches, even if nothing is
17 there. Remember that * matches anything, and the empty string is anything!
18 As a corollary of this behavior, this command always returns immediately.
19 It never waits for new data to arrive. It does not have to since it
20 matches everything.
21 ---
22
23 Could it be that it just matches empty without waiting for anything?
24
25
26 cu
27 Gerrit

Replies

Subject Author
Re: [gentoo-user] OT expect script question Adam Carter <adamcarter3@×××××.com>