【Linux安装expect命令】:--expect是在Tcl基础上创建起来的,所以在安装expect前我们应该先安装Tcl。
①:tcl安装源码下载:http://www.tcl.tk/software/tcltk/downloadnow84.tmlwget http://nchc.dl.sourceforge.net/sourceforge/tcl/tcl8.4.20-src.tar.gz解压:tar -zxvf tcl8.4.20-src.tar.gzcd tcl8.4.20/unix/
./configure --prefix=/usr/tcl --enable-shared
makemake installcp tclUnixPort.h ../generic/②:expect 安装 (需Tcl的库):
下载源码包:wget http://sourceforge.net/projects/expect/files/Expect/5.45/expect5.45.tar.gz/download解压:tar xzvf expect5.45.tar.gz安装配置:cd expect5.45./configure --prefix=/usr/expect --with-tcl=/usr/tcl/lib --with-tclinclude=../tcl8.4.20/genericmake make install ln -s /usr/tcl/bin/expect /usr/expect/bin/expect