Skip to Content
Exploring Expect
book

Exploring Expect

by Don Libes
December 1994
Intermediate to advanced
606 pages
16h 7m
English
O'Reilly Media, Inc.
Content preview from Exploring Expect

The continue And break Actions

Like the expect command, it is possible to have the interact command cause its caller to break or continue. Each of these can be used as an action. For example, in the following loop, if a user presses "+“, interact returns and the while loop breaks.

while {1} {
    interact "+" break
}

The continue command works similarly. In the following loop, if a user presses "+“, the interact returns and the loop breaks. If the "-" is pressed, the interact returns, and the while loop continues.

while {1} {
    interact "+" break "-" continue
}
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

AI Agents in Action

AI Agents in Action

Micheal Lanham
Learning Go

Learning Go

Jon Bodner

Publisher Resources

ISBN: 9781565920903Supplemental ContentErrata Page