Linux安装expect
1、准备工作因为是docker 里面什么都没有需要提前下载一些东西比如make gcc
- apt-get install make
- apt-get install gcc
2.tcl命令安装
下载tcl安装包:https://sourceforge.net/projects/tcl/files/Tcl/8.6.12/tcl8.6.12-src.tar.gz/downloadtar-zxf tcl8.6.12-src.tar.gzcdtcl8.6.12/unix/./configure--prefix=/usr/tcl--enable-sharedmakemakeinstall# 目录tcl8.6.12/unix/下的tclUnixPort.h复制到generic中cptclUnixPort.h ../generic/
3.安装expect
# 下载expect地址:https://jaist.dl.sourceforge.net/project/expect/Expect/5.45.4/expect5.45.4.tar.gztar-zxf expect5.45.4.tar.gzcdexpect5.45.4# 配置expect的安装路径,--with-tcl为告诉configure脚本tcl解释器位置,--with-tclinclude为告诉脚本tcl头文件位置./configure--prefix=/usr/expect--with-tcl=/usr/tcl/lib--with-tclinclude=../tcl8.6.12/genericmakemakeinstallln-s/usr/tcl/bin/expect/usr/expect/bin/expect
这里强调下,在安装的过程中可能存在和中问题,基本上就是makefile 与依赖包的问题,该改的地方改一改,没有包的拉一下基本就没问题了,我这里是没有make 和 make install就已经可以了用了。。。。。
4.写入环境变量
vi/etc/profile# 写入下面内容内容exportPATH=$PATH:/usr/expect/bin/# 更新配置文件source/etc/profile

浙公网安备 33010602011771号