1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| //先安装tcl //下载tcl安装包,https://sourceforge.net/projects/tcl/files/Tcl/8.6.12/tcl8.6.12-src.tar.gz/download tar -zxf tcl8.6.12-src.tar.gz cd tcl8.6.12/unix/ ./configure --prefix=/usr/tcl --enable-shared make make install
# 目录tcl8.6.12/unix/下的tclUnixPort.h复制到generic中 cp tclUnixPort.h ../generic/ 。 # 授权允许普通用户使用 chmod 755 /usr/tcl/lib/expect5.45.4 chmod -R 755 /usr/tcl
//安装expect //下载安装包:https://jaist.dl.sourceforge.net/project/expect/Expect/5.45.4/expect5.45.4.tar.gz
tar -zxf expect5.45.4.tar.gz cd expect5.45.4 ./configure --prefix=/usr/expect --with-tcl=/usr/tcl/lib --with-tclinclude=../tcl8.6.12/generic ##配置expect的安装路径,--with-tcl为告诉configure脚本tcl解释器位置,--with-tclinclude为告诉脚本tcl头文件位置 make make install ln -s /usr/tcl/bin/expect /usr/expect/bin/expect
chmod -R 755 /usr/expect chmod 755 /usr/expect/bin
//命令写入环境变量 vi /etc/profile export PATH=$PATH:/usr/expect/bin/
source /etc/profile
//测试 输入expect命令,看是否进入形如expect1.1>这样的命令行
|