| 1 |
.TH KIBITZ 1 "19 October 1994" |
| 2 |
.SH NAME |
| 3 |
kibitz \- allow two people to interact with one shell |
| 4 |
.SH SYNOPSIS |
| 5 |
.B kibitz |
| 6 |
[ |
| 7 |
.I kibitz-args |
| 8 |
] |
| 9 |
.I user |
| 10 |
[ |
| 11 |
.I program program-args... |
| 12 |
] |
| 13 |
.br |
| 14 |
.B kibitz |
| 15 |
[ |
| 16 |
.I kibitz-args |
| 17 |
] |
| 18 |
.I user@host |
| 19 |
[ |
| 20 |
.I program program-args... |
| 21 |
] |
| 22 |
.SH INTRODUCTION |
| 23 |
.B kibitz |
| 24 |
allows two (or more) people to interact with one shell (or any arbitrary |
| 25 |
program). Uses include: |
| 26 |
.RS |
| 27 |
.TP 4 |
| 28 |
\(bu |
| 29 |
A novice user can ask an expert user for help. Using |
| 30 |
.BR kibitz , |
| 31 |
the expert can see what the user is doing, and offer advice or |
| 32 |
show how to do it right. |
| 33 |
.TP |
| 34 |
\(bu |
| 35 |
By running |
| 36 |
.B kibitz |
| 37 |
and then starting a full-screen editor, people may carry out a |
| 38 |
conversation, retaining the ability to scroll backwards, |
| 39 |
save the entire conversation, or even edit it while in progress. |
| 40 |
.TP |
| 41 |
\(bu |
| 42 |
People can team up on games, document editing, or other cooperative |
| 43 |
tasks where each person has strengths and weaknesses that complement one |
| 44 |
another. |
| 45 |
.RE |
| 46 |
.SH USAGE |
| 47 |
To start |
| 48 |
.BR kibitz , |
| 49 |
user1 |
| 50 |
runs kibitz with the argument of the |
| 51 |
user to kibitz. For example: |
| 52 |
|
| 53 |
kibitz user2 |
| 54 |
|
| 55 |
.B kibitz |
| 56 |
starts a new shell (or another program, if given on the command |
| 57 |
line), while prompting user2 to run |
| 58 |
.BR kibitz . |
| 59 |
If user2 runs |
| 60 |
.B kibitz |
| 61 |
as directed, the keystrokes of both users become the input of |
| 62 |
the shell. Similarly, both users receive the output from the |
| 63 |
shell. |
| 64 |
|
| 65 |
To terminate |
| 66 |
.B kibitz |
| 67 |
it suffices to terminate the shell itself. For example, if either user |
| 68 |
types ^D (and the shell accepts this to be EOF), the shell terminates |
| 69 |
followed by |
| 70 |
.BR kibitz . |
| 71 |
|
| 72 |
Normally, all characters are passed uninterpreted. However, if the |
| 73 |
escape character (described when |
| 74 |
.B kibitz |
| 75 |
starts) is issued, the user |
| 76 |
may talk directly to the |
| 77 |
.B kibitz |
| 78 |
interpreter. Any |
| 79 |
.BR Expect (1) |
| 80 |
or |
| 81 |
.BR Tcl (3) |
| 82 |
commands may be given. |
| 83 |
Also, job control may be used while in the interpreter, to, for example, |
| 84 |
suspend or restart |
| 85 |
.BR kibitz . |
| 86 |
|
| 87 |
Various processes |
| 88 |
can provide various effects. For example, you can emulate a two-way |
| 89 |
.BR write (1) |
| 90 |
session with the command: |
| 91 |
|
| 92 |
kibitz user2 sleep 1000000 |
| 93 |
.SH ARGUMENTS |
| 94 |
.B kibitz |
| 95 |
takes arguments, these should also be separated by whitespace. |
| 96 |
|
| 97 |
The |
| 98 |
.B \-noproc |
| 99 |
flag runs |
| 100 |
.B kibitz |
| 101 |
with no process underneath. Characters are passed to the other |
| 102 |
.BR kibitz . |
| 103 |
This is particularly useful for connecting multiple |
| 104 |
interactive processes together. |
| 105 |
In this mode, characters are not echoed back to the typist. |
| 106 |
|
| 107 |
.B \-noescape |
| 108 |
disables the escape character. |
| 109 |
|
| 110 |
.BI \-escape " char" |
| 111 |
sets the escape character. The default escape character is ^]. |
| 112 |
|
| 113 |
.B \-silent |
| 114 |
turns off informational messages describing what kibitz is doing to |
| 115 |
initiate a connection. |
| 116 |
|
| 117 |
.BI \-tty " ttyname" |
| 118 |
defines the tty to which the invitation should be sent. |
| 119 |
|
| 120 |
If you start |
| 121 |
.B kibitz |
| 122 |
to user2 on a remote computer, |
| 123 |
.B kibitz |
| 124 |
performs a |
| 125 |
.B rlogin |
| 126 |
to the remote computer with your current username. The flag |
| 127 |
.BI \-proxy " username" |
| 128 |
causes |
| 129 |
.B rlogin |
| 130 |
to use |
| 131 |
.I username |
| 132 |
for the remote login (e.g. if your account on the remote computer has a |
| 133 |
different username). If the |
| 134 |
.B \-proxy |
| 135 |
flag is not given, |
| 136 |
.B kibitz |
| 137 |
tries to determine your current username by (in that order) inspecting the |
| 138 |
environment variables USER and LOGNAME, then by using the commands |
| 139 |
.B whoami |
| 140 |
and |
| 141 |
.BR logname . |
| 142 |
|
| 143 |
The arguments |
| 144 |
.B \-noescape |
| 145 |
and |
| 146 |
.B \-escape |
| 147 |
can also be given by user2 when prompted to run |
| 148 |
.BR kibitz . |
| 149 |
|
| 150 |
.SH MORE THAN TWO USERS |
| 151 |
The current implementation of kibitz explicitly understands only two users, |
| 152 |
however, it is nonetheless possible to have a three (or more) -way kibitz, |
| 153 |
by kibitzing another |
| 154 |
.BR kibitz . |
| 155 |
For example, the following command runs |
| 156 |
.B kibitz |
| 157 |
with the current user, user2, and user3: |
| 158 |
|
| 159 |
% kibitz user2 kibitz user3 |
| 160 |
|
| 161 |
Additional users may be added by simply appending more "kibitz user" |
| 162 |
commands. |
| 163 |
|
| 164 |
The |
| 165 |
.B xkibitz |
| 166 |
script is similar to |
| 167 |
.B kibitz |
| 168 |
but supports the ability to add additional users (and drop them) |
| 169 |
dynamically. |
| 170 |
.SH CAVEATS |
| 171 |
.B kibitz |
| 172 |
assumes the 2nd user has the same terminal type and size as the 1st user. |
| 173 |
If this assumption is incorrect, graphical programs may display oddly. |
| 174 |
|
| 175 |
.B kibitz |
| 176 |
handles character graphics, but cannot handle bitmapped graphics. Thus, |
| 177 |
.nf |
| 178 |
|
| 179 |
% xterm \-e kibitz will work |
| 180 |
% kibitz xterm will not work |
| 181 |
|
| 182 |
.fi |
| 183 |
However, you can get the effect of the latter command by using |
| 184 |
.B xkibitz |
| 185 |
(see SEE ALSO below). |
| 186 |
.B kibitz |
| 187 |
uses the same permissions as used by rlogin, rsh, etc. Thus, you |
| 188 |
can only |
| 189 |
.B kibitz |
| 190 |
to users at hosts for which you can rlogin. |
| 191 |
Similarly, |
| 192 |
.B kibitz |
| 193 |
will prompt for a password on the remote host if |
| 194 |
rlogin would. |
| 195 |
|
| 196 |
If you |
| 197 |
.B kibitz |
| 198 |
to users at remote hosts, |
| 199 |
.B kibitz |
| 200 |
needs to distinguish your prompt from other things that may precede it |
| 201 |
during login. |
| 202 |
(Ideally, the end of it is preferred but any part should suffice.) |
| 203 |
If you have an unusual prompt, |
| 204 |
set the environment variable EXPECT_PROMPT to an |
| 205 |
.BR egrep (1)-style |
| 206 |
regular expression. |
| 207 |
Brackets should be preceded with one backslash in ranges, |
| 208 |
and three backslashes for literal brackets. |
| 209 |
The default prompt r.e.\& is "($|%|#)\ ". |
| 210 |
|
| 211 |
.B kibitz |
| 212 |
requires the |
| 213 |
.B kibitz |
| 214 |
program on both hosts. |
| 215 |
.B kibitz |
| 216 |
requires |
| 217 |
.BR expect (1). |
| 218 |
|
| 219 |
By comparison, the |
| 220 |
.B xkibitz |
| 221 |
script uses the X authorization mechanism for inter-host communication |
| 222 |
so it does not need to login, recognize your prompt, or require kibitz |
| 223 |
on the remote host. It does however need permission to access |
| 224 |
the other X servers. |
| 225 |
.SH BUGS |
| 226 |
An early version of Sun's tmpfs had a bug in it that causes |
| 227 |
.B kibitz |
| 228 |
to blow up. If |
| 229 |
.B kibitz |
| 230 |
reports "error flushing ...: Is a directory" |
| 231 |
ask Sun for patch #100174. |
| 232 |
|
| 233 |
If your Expect is not compiled with multiple-process support (i.e., you do not |
| 234 |
have a working select or poll), you will not be able to run kibitz. |
| 235 |
.SH ENVIRONMENT |
| 236 |
The environment variable SHELL is used to determine the shell to start, if no |
| 237 |
other program is given on the command line. |
| 238 |
|
| 239 |
If the environment variable EXPECT_PROMPT exists, it is taken as a regular |
| 240 |
expression which matches the end of your login prompt (but does not otherwise |
| 241 |
occur while logging in). See also CAVEATS above. |
| 242 |
|
| 243 |
If the environment variables USER or LOGNAME are defined, they are used to |
| 244 |
determine the current user name for a |
| 245 |
.B kibitz |
| 246 |
to a remote computer. See description of the |
| 247 |
.B \-proxy |
| 248 |
option in ARGUMENTS above. |
| 249 |
.SH SEE ALSO |
| 250 |
.BR Tcl (3), |
| 251 |
.BR libexpect (3), |
| 252 |
.BR xkibitz (1) |
| 253 |
.br |
| 254 |
.I |
| 255 |
"Exploring Expect: A Tcl-Based Toolkit for Automating Interactive Programs" |
| 256 |
\fRby Don Libes, |
| 257 |
O'Reilly and Associates, January 1995. |
| 258 |
.br |
| 259 |
.I |
| 260 |
"Kibitz \- Connecting Multiple Interactive Programs Together", \fRby Don Libes, |
| 261 |
Software \- Practice & Experience, John Wiley & Sons, West Sussex, England, |
| 262 |
Vol.\& 23, No.\& 5, May, 1993. |
| 263 |
.SH AUTHOR |
| 264 |
Don Libes, National Institute of Standards and Technology |
| 265 |
|
| 266 |
.B kibitz |
| 267 |
is in the public domain. |
| 268 |
NIST and I would |
| 269 |
appreciate credit if this program or parts of it are used. |