%general-entities; ]> expect &expect-version;
&expect-url;
Expect-&expect-version; Expect <!--para>The Expect package contains a program for carrying out scripted dialogues with other interactive programs.</para--> <para>Expect 软件包包含一个根据脚本,与其他交互程序进行对话的程序。 </para> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> <seg>&expect-ch5-sbu;</seg> <seg>&expect-ch5-du;</seg> </seglistitem> </segmentedlist> </sect2> <sect2 role="installation"> <title>安装 Expect 首先强制 Expect 的配置脚本使用 /bin/stty, 而不是宿主系统上可能存在的 /usr/local/bin/stty, 以保证测试套件工具在最终构建工具链时仍然完整: cp -v configure{,.orig} sed 's:/usr/local/bin:/bin:' configure.orig > configure 现在准备编译 Expect: ./configure --prefix=/tools \ --with-tcl=/tools/lib \ --with-tclinclude=/tools/include 配置选项的含义: --with-tcl=/tools/lib 这保证配置脚本找到临时工具中的 Tcl 安装, 而不是宿主系统中可能存在的 Tcl 安装。 --with-tclinclude=/tools/include 该选项明确告诉 Expect 去哪里寻找 Tcl 的内部头文件。 使用该选项可以避免某些情况下 configure 由于找不到 Tcl 头文件的位置而失败。 构建该软件包: make 现在编译已经完成,正如之前所述, 并不需要运行本章中临时工具的测试套件。如果一定要运行 Expect 的测试套件,输入以下命令: make test 注意,已经知道在特定宿主环境下 Expect 测试套件会失败。 我们无法控制宿主环境,因此这里的测试失败并不令人吃惊, 也不会造成严重问题。 安装该软件包: make SCRIPTS="" install make 命令参数的含义: SCRIPTS="" 该选项使得一些不需要的 Expect 辅助脚本不被安装。 Expect 的内容 安装的程序 安装的库 expect libexpect-&expect-lib-version;.so 简要描述 expect 根据一个脚本与其他交互程序交流 expect libexpect-&expect-lib-version;.so 包含一些函数,使得 Expect 可以作为 Tcl 扩展使用, 也可以直接在 C 或 C++ 中使用(不使用 Tcl) libexpect-&expect-lib-version;