参考 : http://www.mamicode.com/info-detail-2645084.html
创建shell脚本,内容如下
#!/usr/bin/expect
spawn ssh root@1.1.1.1
expect "*password:"
send "root\r"
expect "*#"
interact
若出现如下错误
-bash: ./66.sh: /usr/bin/expect: 坏的解释器: 没有那个文件或目录
安装 expect
yum install -y expect
END。
本文介绍了一种常见错误:在使用expect脚本进行SSH连接时遇到'bad interpreter: No such file or directory'的问题,并提供了详细的解决方案,包括如何正确安装expect软件包。
5450

被折叠的 条评论
为什么被折叠?



