在shell中插入expect命令。
来源:互联网 发布:java调用外部接口 编辑:程序博客网 时间:2024/06/02 04:15
#!/bin/bashn=0while :do n=$((n+1)) echo "test count=" $n expect << __EOF set timeout 30 spawn ssh root@192.168.2.195 expect { "(yes/no)?" { send "yes\r" ; exp_continue } "password:" { send "123456\r" } } expect "iBMC:/->" send "ipmcset -d powerstate -v 2\r" expect "Do you want to continue\?\[Y\N\]:" send "Y\r" sleep 5 expect "iBMC:/->" send "ipmcset -d powerstate -v 1\r" expect "Do you want to continue\?\[Y\N\]:" send "Y\r" expect "iBMC:/->" send "exit\r" interact__EOF sleep 5mdone
阅读全文
0 0
- 在shell中插入expect命令。
- shell中嵌套执行expect命令实例
- expect中使用exec执行shell命令的方法
- expect中使用exec执行shell命令的方法
- 如何在shell脚本中调用expect实现自动化
- 在shell中使用expect+ssh登陆远程服务器
- 在shell脚本中利用expect实现自动应答
- 在shell脚本中利用expect实现自动应答
- 在shell脚本中使用expect实现scp传输问题
- expect调用shell命令或shell脚本
- shell中嵌入expect脚本
- shell中插入expect脚本的执行,注意EOF后面的空格
- Shell脚本学习之expect命令
- Shell脚本学习之expect命令
- shell脚本expect命令send特殊字符
- shell脚本嵌套执行expect命令
- Shell脚本学习之expect命令
- Shell脚本学习之expect命令
- JAVA课程作业1--骰子游戏
- 《不抱怨的世界》
- [BZOJ1019][SHOI2008]汉诺塔
- python核心编程-2
- 神经网络案例分析4-5-神经网络遗传算法函数极值寻优-基于BP_Adaboost 的强分类器设计
- 在shell中插入expect命令。
- application.properties详解 --springBoot配置文件
- JAVA初窥:Zip压缩工具类(一)(解决中文乱码)
- 曾凡平老师《网络信息安全》实验
- 题目
- @responseBody注解的使用
- YUV(二)-YUV格式转换缩放
- 设计模式【中介者模式Mediator Pattern】
- [心得]学习总结