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

Controlling Multiple Processes—kibitz

It is possible to connect more than two processes simply by identifying more than two spawn ids with the -input or -output flags. The kibitz script that comes with Expect does this. First, I will describe kibitz from the user’s point of view.

By default, kibitz runs a shell and connects both the original user and another user to it. The keystrokes of both users are sent to the shell and both users see the results. kibitz is ideal for allowing two people to see what one another is doing. For example, a novice user who is having a problem can use kibitz to let an expert see in real time what is going awry. The expert can begin typing at any time, showing the user the correct way to do something.

Lots of other uses are possible. For example, by running a full-screen editor, two people may carry out a conversation, and have the ability to scroll backwards, save the entire conversation, or even edit it while in progress. People can team up on games, document editing, or other cooperative tasks where each person has strengths and weaknesses that complement one another.

kibitz is started by the first user typing kibitz followed by the user name.

% kibitz debtron

This causes the second user (debtron) to be prompted to run kibitz. The user sees a message in their console asking them to run kibitz. The user sees:

Can we talk?  Run: kibitz -20899

The request includes a special argument to allow the two kibitz sessions to communicate. (In fact, it tells the second ...

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