【Linux安裝expect命令】:--expect是在Tcl基礎上創建起來的,所以在安裝expect前我們應該先安裝Tcl。
①:tcl安裝
源碼下載:
http://www.tcl.tk/software/tcltk/downloadnow84.tml
wget 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 安裝 (需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/generic
make
make install
ln -s /usr/tcl/bin/expect /usr/expect/bin/expect