linux下的expect的安装及使用

用在连接云服务器时不用输密码:
自己本地的输入有:
vim cloud_server
添加内容:#!/usr/bin/expect
spawn ssh 云服务器地址及端口号
expect “password:”
send “连接的密码\r”
interact

chmod 777 cloud_server
./cloud_server
报错:bash: ./cloud_server: /usr/bin/expect: bad interpreter: No such file or directory
解决:安装tcl,expect,主要参考下面两个博客,主要按照博客1,参考博客2
博客1:
Expect工具的安装及使用方法:https://blog.csdn.net/wangtaoking1/article/details/78268574
博客2:
linux下的expect的安装和使用:https://blog.csdn.net/silenceray/article/details/54582345

遇到问题:执行 ./configure --with-tcl=/usr/local/lib --with-tclinclude=…/tcl8.4.19/generic 后,显示错误checking for Tcl public headers… configure: error: …/tcl8.4.19/generic directory does not contain tcl.h
解决:结合博客2.把tcl.8.4.19放在/tmp/下,把执行语句改成tcl.8.4.19的具体位置,
变为: ./configure --with-tcl=/usr/local/lib --with-tclinclude=/tmp/tcl8.4.19/generic 解决问题。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值