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