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/download
  • tar-zxf tcl8.6.12-src.tar.gz
  • cdtcl8.6.12/unix/
  • ./configure--prefix=/usr/tcl--enable-shared
  • make
  • makeinstall
  • # 目录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.gz
  • tar -zxf expect5.45.4.tar.gz
  • cd expect5.45.4
  • # 配置expect的安装路径,--with-tcl为告诉configure脚本tcl解释器位置,--with-tclinclude为告诉脚本tcl头文件位置
  • ./configure --prefix=/usr/expect --with-tcl=/usr/tcl/lib --with-tclinclude=../tcl8.6.12/generic    
  • make
  • make install
  • ln -s /usr/tcl/bin/expect /usr/expect/bin/expect

这里强调下,在安装的过程中可能存在和中问题,基本上就是makefile 与依赖包的问题,该改的地方改一改,没有包的拉一下基本就没问题了,我这里是没有make 和 make install就已经可以了用了。。。。。

4.写入环境变量

  • vi /etc/profile
  • # 写入下面内容内容
  • export PATH=$PATH:/usr/expect/bin/
  • # 更新配置文件
  • source  /etc/profile

 

 

posted @ 2023-01-03 14:07  dkzou  阅读(845)  评论(0编辑  收藏  举报