使用expect实现shell的交互
2012-06-28 15:15
603 查看
1.安装expect
yum install expect
2.编写脚本
demo.exp:
3.这样,当shell脚本中出现了要求输入密码的时候,脚本就自动输入了。
yum install expect
2.编写脚本
demo.exp:
spawn /var/www/html/imagesDirBackup.sh expect "password:" send "ispass\r"
3.这样,当shell脚本中出现了要求输入密码的时候,脚本就自动输入了。
相关文章推荐
- 使用expect实现shell自动交互
- 使用expect实现shell自动交互
- 使用expect实现shell自动交互
- [转载]使用expect实现shell自动交互
- 【转】使用expect实现shell自动交互
- 使用expect实现shell的交互
- 使用expect实现shell自动交互
- 使用expect实现shell自动交互
- 使用expect实现shell自动交互
- linux shell使用expect实现sftp的自动交互
- expect 实现与shell交互
- linux 下使用expect编写shell 脚本交互访问远程服务器
- 【MongoDB】在Mongodb使用shell实现与javascript的动态交互
- SSH使用expect实现密码交互脚本
- 使用spawn和expect实现自动交互
- UNIX/LINUX使用expect实现人机自动交互功能
- shell脚本通过expect脚本实现自动输入密码(使用expect)
- 利用expect命令实现Shell自动化交互的方法详解
- 使用expect实现shell脚本中scp,ssh自动输入口令
- Linux基于expect(tcl)实现shell自动交互