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