OSDN Git Service

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