自动化工具expect的搭建和简单使用

来源:互联网 发布:mac怎么下载2个qq 编辑:程序博客网 时间:2024/05/29 02:49

expect是建立在tcl基础上的一个工具,它用来让一些需要交互的任务自动化地完成。

因为expect是基于tcl的,所以需要你的系统中安装有tcl

检查系统种是否有tcl.

[root@dev ~]# whereis tcl
tcl: /usr/lib/tcl8.4 /usr/share/tcl8.4
如果看不到结果,请先安装tcl


安装tcl:
下载地址:http://nchc.dl.sourceforge.net/sourceforge/tcl/tcl8.4.11-src.tar.gz

tar -zxvf tcl8.4.11-src.tar.gz
cd tcl8.4.11/unix/
 ./configure
make && make install
安装expect(下载地址:http://sourceforge.net/projects/expect/files/Expect/5.45/expect5.45.tar.gz/download
 tar -zxvf expect5.45.tar.gz 
 cd expect5.45
./configure --with-tclinclude=/tmp/tcl8.4.11/generic --with-tclconfig=/usr/local/lib/

make && make install


检查安装情况

[root@node1 expect5.45]# expect
expect1.1> 
expect1.1> 

安装完成.


参考:http://blog.csdn.net/catoop/article/details/48289991

           http://blog.csdn.net/silenceray/article/details/54582345