操作方法
下载tcl源码包 wget http://prdownloads.sourceforge.net/tcl/tcl8.4.20-src.tar.gz
解压并编译安装tcl tar zxvf tcl8.4.20-src.tar.gz cd tcl8.4.20/unix/ ./configure --prefix=/usr/tcl --enable-shared make make install 如果编译成功没报错如下图
安装完毕以后进入tcl源代码的根目录,把子目录unix下面的tclUnixPort.h copy到子目录generic中,expect的安装过程还需要用 cp unix/tclUnixPort.h generic/.
下载expect源码包 wget http://sourceforge.net/projects/expect/files/Expect/5.45/expect5.45.tar.gz
解压并编译安装expect 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
加入环境变量并测试 echo 'export PATH=$PATH:/usr/expect/bin' >>/etc/profile