1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY expect-download-http "&sourceforge-dl;/expect/expect&expect-version;.tar.gz">
|
---|
8 | <!ENTITY expect-download-ftp " ">
|
---|
9 | <!ENTITY expect-md5sum "00fce8de158422f5ccd2666512329bd2">
|
---|
10 | <!ENTITY expect-size "624 KB">
|
---|
11 | <!ENTITY expect-buildsize "3.2 MB (with tests)">
|
---|
12 | <!ENTITY expect-time "0.2 SBU (with tests)">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="expect" xreflabel="Expect-&expect-version;">
|
---|
16 | <?dbhtml filename="expect.html"?>
|
---|
17 |
|
---|
18 |
|
---|
19 | <title>Expect-&expect-version;</title>
|
---|
20 |
|
---|
21 | <indexterm zone="expect">
|
---|
22 | <primary sortas="a-Expect">Expect</primary>
|
---|
23 | </indexterm>
|
---|
24 |
|
---|
25 | <sect2 role="package">
|
---|
26 | <title>Introduction to Expect</title>
|
---|
27 |
|
---|
28 | <para>
|
---|
29 | The <application>Expect</application> package was installed in the
|
---|
30 | LFS temporary tools directory for testing other packages. These
|
---|
31 | procedures install it in a permanent location. It contains tools for
|
---|
32 | automating interactive applications such as <command>telnet</command>,
|
---|
33 | <command>ftp</command>, <command>passwd</command>,
|
---|
34 | <command>fsck</command>, <command>rlogin</command>,
|
---|
35 | <command>tip</command>, etc. <application>Expect</application> is also
|
---|
36 | useful for testing these same applications as well as easing all sorts of
|
---|
37 | tasks that are prohibitively difficult with anything else.
|
---|
38 | </para>
|
---|
39 |
|
---|
40 | &lfs91_checked;
|
---|
41 |
|
---|
42 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
43 | <itemizedlist spacing="compact">
|
---|
44 | <listitem>
|
---|
45 | <para>
|
---|
46 | Download (HTTP): <ulink url="&expect-download-http;"/>
|
---|
47 | </para>
|
---|
48 | </listitem>
|
---|
49 | <!-- <listitem>
|
---|
50 | <para>
|
---|
51 | Download (FTP): <ulink url="&expect-download-ftp;"/>
|
---|
52 | </para>
|
---|
53 | </listitem> -->
|
---|
54 | <listitem>
|
---|
55 | <para>
|
---|
56 | Download MD5 sum: &expect-md5sum;
|
---|
57 | </para>
|
---|
58 | </listitem>
|
---|
59 | <listitem>
|
---|
60 | <para>
|
---|
61 | Download size: &expect-size;
|
---|
62 | </para>
|
---|
63 | </listitem>
|
---|
64 | <listitem>
|
---|
65 | <para>
|
---|
66 | Estimated disk space required: &expect-buildsize;
|
---|
67 | </para>
|
---|
68 | </listitem>
|
---|
69 | <listitem>
|
---|
70 | <para>
|
---|
71 | Estimated build time: &expect-time;
|
---|
72 | </para>
|
---|
73 | </listitem>
|
---|
74 | </itemizedlist>
|
---|
75 |
|
---|
76 | <bridgehead renderas="sect3">Expect Dependencies</bridgehead>
|
---|
77 |
|
---|
78 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
79 | <para role="required">
|
---|
80 | <xref linkend="tcl"/>
|
---|
81 | </para>
|
---|
82 |
|
---|
83 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
84 | <para role="optional">
|
---|
85 | <xref linkend="tk"/>
|
---|
86 | </para>
|
---|
87 |
|
---|
88 | <para condition="html" role="usernotes">User Notes:
|
---|
89 | <ulink url="&blfs-wiki;/expect"/></para>
|
---|
90 |
|
---|
91 | </sect2>
|
---|
92 |
|
---|
93 | <sect2 role="installation">
|
---|
94 | <title>Installation of Expect</title>
|
---|
95 |
|
---|
96 | <para>
|
---|
97 | Install <application>Expect</application> by running the following
|
---|
98 | commands:
|
---|
99 | </para>
|
---|
100 |
|
---|
101 | <!-- Not sure if we need a static library as it does not build by default
|
---|
102 | any longer. Only a .so library is installed when passing
|
---|
103 | 'enable-shared'. -->
|
---|
104 | <screen><userinput>./configure --prefix=/usr \
|
---|
105 | --with-tcl=/usr/lib \
|
---|
106 | --enable-shared \
|
---|
107 | --mandir=/usr/share/man \
|
---|
108 | --with-tclinclude=/usr/include &&
|
---|
109 | make</userinput></screen>
|
---|
110 |
|
---|
111 | <para>
|
---|
112 | To test the results, issue: <command>make test</command>.
|
---|
113 | </para>
|
---|
114 |
|
---|
115 | <para>
|
---|
116 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
117 | </para>
|
---|
118 |
|
---|
119 | <screen role="root"><userinput>make install &&
|
---|
120 | ln -svf expect&expect-version;/libexpect&expect-version;.so /usr/lib</userinput></screen>
|
---|
121 |
|
---|
122 | </sect2>
|
---|
123 |
|
---|
124 | <sect2 role="commands">
|
---|
125 | <title>Command Explanations</title>
|
---|
126 |
|
---|
127 | <para>
|
---|
128 | <parameter>-with-tcl=/usr/lib</parameter>: This parameter is used to
|
---|
129 | tell the <command>configure</command> script where the
|
---|
130 | <command>tclConfig.sh</command> is located.
|
---|
131 | </para>
|
---|
132 |
|
---|
133 | <para>
|
---|
134 | <parameter>--enable-shared</parameter>: This option enables
|
---|
135 | building the shared library.
|
---|
136 | </para>
|
---|
137 |
|
---|
138 | <!-- Not really sure if this is required any longer as the library is now
|
---|
139 | installed directly in /usr/lib/expect5.45/. -->
|
---|
140 | <para>
|
---|
141 | <command>ln -sf ...</command>: This command creates a required link
|
---|
142 | to the shared library.
|
---|
143 | </para>
|
---|
144 |
|
---|
145 | </sect2>
|
---|
146 |
|
---|
147 | <sect2 role="configuration">
|
---|
148 | <title>Configuring Expect</title>
|
---|
149 |
|
---|
150 | <sect3 id="expect-config">
|
---|
151 | <title>Config Files</title>
|
---|
152 |
|
---|
153 | <para>
|
---|
154 | <filename>$exp_library/expect.rc</filename> and
|
---|
155 | <filename>~/.expect.rc</filename>
|
---|
156 | </para>
|
---|
157 |
|
---|
158 | <indexterm zone="expect expect-config">
|
---|
159 | <primary sortas="e-AA.expect.rc">~/.expect.rc</primary>
|
---|
160 | </indexterm>
|
---|
161 |
|
---|
162 | <indexterm zone="expect expect-config">
|
---|
163 | <primary sortas="e-A.exp_library-expect.rc">$exp_library/expect.rc</primary>
|
---|
164 | </indexterm>
|
---|
165 |
|
---|
166 | </sect3>
|
---|
167 |
|
---|
168 | <sect3>
|
---|
169 | <title>Configuration Information</title>
|
---|
170 |
|
---|
171 | <para>
|
---|
172 | Reference the <command>expect</command> man page for information about
|
---|
173 | utilizing the <filename>expect.rc</filename> configuration files.
|
---|
174 | Additionally, many of the tools contained in the
|
---|
175 | <application>Expect</application> package will use their own
|
---|
176 | configuration files. Reference the respective man page, or
|
---|
177 | examine the script directly for configuration file information.
|
---|
178 | </para>
|
---|
179 |
|
---|
180 | </sect3>
|
---|
181 |
|
---|
182 | </sect2>
|
---|
183 |
|
---|
184 | <sect2 role="content">
|
---|
185 | <title>Contents</title>
|
---|
186 |
|
---|
187 | <segmentedlist>
|
---|
188 | <segtitle>Installed Programs</segtitle>
|
---|
189 | <segtitle>Installed Library</segtitle>
|
---|
190 | <segtitle>Installed Directory</segtitle>
|
---|
191 |
|
---|
192 | <seglistitem>
|
---|
193 | <seg>autoexpect, autopasswd, cryptdir, decryptdir, dislocate, expect, ftp-rfc,
|
---|
194 | kibitz, lpunlock, mkpasswd, passmass, rftp, rlogin-cwd, timed-read, timed-run,
|
---|
195 | unbuffer, weather, and optionally (if <application>Expect</application> was
|
---|
196 | linked against <application>Tk</application>), multixterm,
|
---|
197 | tknewsbiff, tkpasswd, xkibitz, and xpstat</seg>
|
---|
198 | <seg>libexpect&expect-version;.so</seg>
|
---|
199 | <seg>/usr/lib/expect&expect-version;</seg>
|
---|
200 | </seglistitem>
|
---|
201 | </segmentedlist>
|
---|
202 |
|
---|
203 | <variablelist>
|
---|
204 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
205 | <?dbfo list-presentation="list"?>
|
---|
206 | <?dbhtml list-presentation="table"?>
|
---|
207 |
|
---|
208 | <varlistentry id="autoexpect">
|
---|
209 | <term><command>autoexpect</command></term>
|
---|
210 | <listitem>
|
---|
211 | <para>
|
---|
212 | generates an <application>Expect</application> script from
|
---|
213 | watching a session.
|
---|
214 | </para>
|
---|
215 | <indexterm zone="expect autoexpect">
|
---|
216 | <primary sortas="b-autoexpect">autoexpect</primary>
|
---|
217 | </indexterm>
|
---|
218 | </listitem>
|
---|
219 | </varlistentry>
|
---|
220 |
|
---|
221 | <varlistentry id="autopasswd">
|
---|
222 | <term><command>autopasswd</command></term>
|
---|
223 | <listitem>
|
---|
224 | <para>
|
---|
225 | is a wrapper to make <command>passwd</command>(1) be
|
---|
226 | non-interactive.
|
---|
227 | </para>
|
---|
228 | <indexterm zone="expect autopasswd">
|
---|
229 | <primary sortas="b-autopasswd">autopasswd</primary>
|
---|
230 | </indexterm>
|
---|
231 | </listitem>
|
---|
232 | </varlistentry>
|
---|
233 |
|
---|
234 | <varlistentry id="cryptdir">
|
---|
235 | <term><command>cryptdir</command></term>
|
---|
236 | <listitem>
|
---|
237 | <para>
|
---|
238 | encrypts all files in a directory.
|
---|
239 | </para>
|
---|
240 | <indexterm zone="expect cryptdir">
|
---|
241 | <primary sortas="b-cryptdir">cryptdir</primary>
|
---|
242 | </indexterm>
|
---|
243 | </listitem>
|
---|
244 | </varlistentry>
|
---|
245 |
|
---|
246 | <varlistentry id="decryptdir">
|
---|
247 | <term><command>decryptdir</command></term>
|
---|
248 | <listitem>
|
---|
249 | <para>
|
---|
250 | decrypts all files in a directory.
|
---|
251 | </para>
|
---|
252 | <indexterm zone="expect decryptdir">
|
---|
253 | <primary sortas="b-decryptdir">decryptdir</primary>
|
---|
254 | </indexterm>
|
---|
255 | </listitem>
|
---|
256 | </varlistentry>
|
---|
257 |
|
---|
258 | <varlistentry id="dislocate">
|
---|
259 | <term><command>dislocate</command></term>
|
---|
260 | <listitem>
|
---|
261 | <para>
|
---|
262 | allows processes to be disconnected and reconnected to a
|
---|
263 | terminal.
|
---|
264 | </para>
|
---|
265 | <indexterm zone="expect dislocate">
|
---|
266 | <primary sortas="b-dislocate">dislocate</primary>
|
---|
267 | </indexterm>
|
---|
268 | </listitem>
|
---|
269 | </varlistentry>
|
---|
270 |
|
---|
271 | <varlistentry id="expect-prog">
|
---|
272 | <term><command>expect</command></term>
|
---|
273 | <listitem>
|
---|
274 | <para>
|
---|
275 | is a program that <quote>talks</quote> to other interactive
|
---|
276 | programs according to a script.
|
---|
277 | </para>
|
---|
278 | <indexterm zone="expect expect-prog">
|
---|
279 | <primary sortas="b-expect">expect</primary>
|
---|
280 | </indexterm>
|
---|
281 | </listitem>
|
---|
282 | </varlistentry>
|
---|
283 |
|
---|
284 | <varlistentry id="ftp-rfc">
|
---|
285 | <term><command>ftp-rfc</command></term>
|
---|
286 | <listitem>
|
---|
287 | <para>
|
---|
288 | retrieves an RFC (or the index) from UUNET.
|
---|
289 | </para>
|
---|
290 | <indexterm zone="expect ftp-rfc">
|
---|
291 | <primary sortas="b-ftp-rfc">ftp-rfc</primary>
|
---|
292 | </indexterm>
|
---|
293 | </listitem>
|
---|
294 | </varlistentry>
|
---|
295 |
|
---|
296 | <varlistentry id="kibitz">
|
---|
297 | <term><command>kibitz</command></term>
|
---|
298 | <listitem>
|
---|
299 | <para>
|
---|
300 | allows two (or more) people to interact with one shell
|
---|
301 | (or any arbitrary program).
|
---|
302 | </para>
|
---|
303 | <indexterm zone="expect kibitz">
|
---|
304 | <primary sortas="b-kibitz">kibitz</primary>
|
---|
305 | </indexterm>
|
---|
306 | </listitem>
|
---|
307 | </varlistentry>
|
---|
308 |
|
---|
309 | <varlistentry id="lpunlock">
|
---|
310 | <term><command>lpunlock</command></term>
|
---|
311 | <listitem>
|
---|
312 | <para>
|
---|
313 | unhangs a printer which claims it is <quote>waiting for
|
---|
314 | lock</quote>.
|
---|
315 | </para>
|
---|
316 | <indexterm zone="expect lpunlock">
|
---|
317 | <primary sortas="b-lpunlock">lpunlock</primary>
|
---|
318 | </indexterm>
|
---|
319 | </listitem>
|
---|
320 | </varlistentry>
|
---|
321 |
|
---|
322 | <varlistentry id="mkpasswd">
|
---|
323 | <term><command>mkpasswd</command></term>
|
---|
324 | <listitem>
|
---|
325 | <para>
|
---|
326 | generates passwords and can apply them automatically to users.
|
---|
327 | </para>
|
---|
328 | <indexterm zone="expect mkpasswd">
|
---|
329 | <primary sortas="b-mkpasswd">mkpasswd</primary>
|
---|
330 | </indexterm>
|
---|
331 | </listitem>
|
---|
332 | </varlistentry>
|
---|
333 |
|
---|
334 | <varlistentry id="passmass">
|
---|
335 | <term><command>passmass</command></term>
|
---|
336 | <listitem>
|
---|
337 | <para>
|
---|
338 | changes a password on multiple machines.
|
---|
339 | </para>
|
---|
340 | <indexterm zone="expect passmass">
|
---|
341 | <primary sortas="b-passmass">passmass</primary>
|
---|
342 | </indexterm>
|
---|
343 | </listitem>
|
---|
344 | </varlistentry>
|
---|
345 |
|
---|
346 | <varlistentry id="rftp">
|
---|
347 | <term><command>rftp</command></term>
|
---|
348 | <listitem>
|
---|
349 | <para>
|
---|
350 | is much like <command>ftp</command> except it uses
|
---|
351 | <option>~g</option> and <option>~p</option> instead of
|
---|
352 | <option>mget</option> and <option>mput</option>.
|
---|
353 | </para>
|
---|
354 | <indexterm zone="expect rftp">
|
---|
355 | <primary sortas="b-rftp">rftp</primary>
|
---|
356 | </indexterm>
|
---|
357 | </listitem>
|
---|
358 | </varlistentry>
|
---|
359 |
|
---|
360 | <varlistentry id="rlogin-cwd">
|
---|
361 | <term><command>rlogin-cwd</command></term>
|
---|
362 | <listitem>
|
---|
363 | <para>
|
---|
364 | is <command>rlogin</command> except it uses the local current
|
---|
365 | directory as the current working directory on the remote machine.
|
---|
366 | </para>
|
---|
367 | <indexterm zone="expect rlogin-cwd">
|
---|
368 | <primary sortas="b-rlogin-cwd">rlogin-cwd</primary>
|
---|
369 | </indexterm>
|
---|
370 | </listitem>
|
---|
371 | </varlistentry>
|
---|
372 |
|
---|
373 | <varlistentry id="timed-read">
|
---|
374 | <term><command>timed-read</command></term>
|
---|
375 | <listitem>
|
---|
376 | <para>
|
---|
377 | reads a complete line from stdin and aborts after a given
|
---|
378 | number of seconds.
|
---|
379 | </para>
|
---|
380 | <indexterm zone="expect timed-read">
|
---|
381 | <primary sortas="b-timed-read">timed-read</primary>
|
---|
382 | </indexterm>
|
---|
383 | </listitem>
|
---|
384 | </varlistentry>
|
---|
385 |
|
---|
386 | <varlistentry id="timed-run">
|
---|
387 | <term><command>timed-run</command></term>
|
---|
388 | <listitem>
|
---|
389 | <para>
|
---|
390 | runs a program for a given amount of time.
|
---|
391 | </para>
|
---|
392 | <indexterm zone="expect timed-run">
|
---|
393 | <primary sortas="b-timed-run">timed-run</primary>
|
---|
394 | </indexterm>
|
---|
395 | </listitem>
|
---|
396 | </varlistentry>
|
---|
397 |
|
---|
398 | <varlistentry id="unbuffer">
|
---|
399 | <term><command>unbuffer</command></term>
|
---|
400 | <listitem>
|
---|
401 | <para>
|
---|
402 | disables the output buffering that occurs when program output
|
---|
403 | is redirected.
|
---|
404 | </para>
|
---|
405 | <indexterm zone="expect unbuffer">
|
---|
406 | <primary sortas="b-unbuffer">unbuffer</primary>
|
---|
407 | </indexterm>
|
---|
408 | </listitem>
|
---|
409 | </varlistentry>
|
---|
410 |
|
---|
411 | <varlistentry id="weather">
|
---|
412 | <term><command>weather</command></term>
|
---|
413 | <listitem>
|
---|
414 | <para>
|
---|
415 | retrieves a weather report (courtesy University of Michigan)
|
---|
416 | for a given city or geographical area.
|
---|
417 | </para>
|
---|
418 | <indexterm zone="expect weather">
|
---|
419 | <primary sortas="b-weather">weather</primary>
|
---|
420 | </indexterm>
|
---|
421 | </listitem>
|
---|
422 | </varlistentry>
|
---|
423 |
|
---|
424 | <varlistentry id="multixterm">
|
---|
425 | <term><command>multixterm</command></term>
|
---|
426 | <listitem>
|
---|
427 | <para>
|
---|
428 | creates multiple <command>xterm</command>s that can be driven
|
---|
429 | together or separately.
|
---|
430 | </para>
|
---|
431 | <indexterm zone="expect multixterm">
|
---|
432 | <primary sortas="b-multixterm">multixterm</primary>
|
---|
433 | </indexterm>
|
---|
434 | </listitem>
|
---|
435 | </varlistentry>
|
---|
436 |
|
---|
437 | <varlistentry id="tknewsbiff">
|
---|
438 | <term><command>tknewsbiff</command></term>
|
---|
439 | <listitem>
|
---|
440 | <para>
|
---|
441 | pops up a window when there is unread news in your favorite
|
---|
442 | newsgroups and removes the window after you've read the news.
|
---|
443 | </para>
|
---|
444 | <indexterm zone="expect tknewsbiff">
|
---|
445 | <primary sortas="b-tknewsbiff">tknewsbiff</primary>
|
---|
446 | </indexterm>
|
---|
447 | </listitem>
|
---|
448 | </varlistentry>
|
---|
449 |
|
---|
450 | <varlistentry id="tkpasswd">
|
---|
451 | <term><command>tkpasswd</command></term>
|
---|
452 | <listitem>
|
---|
453 | <para>
|
---|
454 | is a script to change passwords using
|
---|
455 | <command>expect</command> and <application>Tk</application>.
|
---|
456 | </para>
|
---|
457 | <indexterm zone="expect tkpasswd">
|
---|
458 | <primary sortas="b-tkpasswd">tkpasswd</primary>
|
---|
459 | </indexterm>
|
---|
460 | </listitem>
|
---|
461 | </varlistentry>
|
---|
462 |
|
---|
463 | <varlistentry id="xkibitz">
|
---|
464 | <term><command>xkibitz</command></term>
|
---|
465 | <listitem>
|
---|
466 | <para>
|
---|
467 | allows users in separate <command>xterm</command>s to share one
|
---|
468 | shell (or any program that runs in an <command>xterm</command>).
|
---|
469 | </para>
|
---|
470 | <indexterm zone="expect xkibitz">
|
---|
471 | <primary sortas="b-xkibitz">xkibitz</primary>
|
---|
472 | </indexterm>
|
---|
473 | </listitem>
|
---|
474 | </varlistentry>
|
---|
475 |
|
---|
476 | <varlistentry id="xpstat">
|
---|
477 | <term><command>xpstat</command></term>
|
---|
478 | <listitem>
|
---|
479 | <para>
|
---|
480 | is a script that acts as a front-end for <command>xpilot</command>.
|
---|
481 | </para>
|
---|
482 | <indexterm zone="expect xpstat">
|
---|
483 | <primary sortas="b-xpstat">xpstat</primary>
|
---|
484 | </indexterm>
|
---|
485 | </listitem>
|
---|
486 | </varlistentry>
|
---|
487 |
|
---|
488 | <varlistentry id="libexpect">
|
---|
489 | <term><filename class='libraryfile'>libexpect&expect-version;.so</filename></term>
|
---|
490 | <listitem>
|
---|
491 | <para>
|
---|
492 | contains functions that allow <application>Expect</application> to
|
---|
493 | be used as a <application>Tcl</application> extension or to be
|
---|
494 | used directly from C or C++ (without
|
---|
495 | <application>Tcl</application>).
|
---|
496 | </para>
|
---|
497 | <indexterm zone="expect libexpect">
|
---|
498 | <primary sortas="c-libexpect&expect-version;">libexpect&expect-version;.so</primary>
|
---|
499 | </indexterm>
|
---|
500 | </listitem>
|
---|
501 | </varlistentry>
|
---|
502 |
|
---|
503 | </variablelist>
|
---|
504 |
|
---|
505 | </sect2>
|
---|
506 |
|
---|
507 | </sect1>
|
---|