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 @   dkzou  阅读(874)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
点击右上角即可分享
微信分享提示