第一种方式:
yum install expect
第二种方式:
安装Tcl:
下载源码包:
http://www.tcl.tk/software/tcltk/downloadnow84.tml
http://nchc.dl.sourceforge.net/sourceforge/tcl/tcl8.4.20-src.tar.gz
解压编译安装:
tar -zxvf tcl8.4.20-src.tar.gz
cd tcl8.4.20/unix
./configure --prefix=/usr/tcl --enable-shared
make
make install
cp tclUnixPort.h ../generic/
安装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 --prefix=/usr/expect --with-tcl=/usr/tcl/lib --with-tclinclude=../tcl8.4.20/generic
make
make install
## 建立软连接
ln -s /usr/tcl/bin/expect /usr/expect/bin/expect