Linux安装expect

1、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/

2、安装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

3、写入环境变量

vi /etc/profile
# 写入下面内容内容
export PATH=$PATH:/usr/expect/bin/

# 更新配置文件
source  /etc/profile

4、输入expect命令,看是否进入形如expect1.1>这样的命令行。

啊?进不去??入口都给你了,进不去??

 

 

 

posted @ 2022-06-30 15:51  云村的王子  阅读(2584)  评论(1编辑  收藏  举报