expect 使用说明
来源:互联网 发布:网络红包利大于弊辩论 编辑:程序博客网 时间:2024/06/18 17:50
tomcat1:/root/sbin# cat expect.exp #!/usr/bin/expectspawn ssh root@192.168.32.169expect { "(yes/no)?" { send "yes\n" expect "assword:" send "1234567\n" } "assword:" { send "1234567\n" } }expect "#" send "ls -ltr\n"send "exit\r"expect eoftomcat1:/root/sbin# expect expect.exp spawn ssh root@192.168.32.169root@192.168.32.169's password: Last login: Tue May 26 16:42:20 2015 from 192.168.32.169tomcat1:/root# ls -ltrtotal 48-rw-r--r--. 1 root root 7572 Jan 15 17:26 install.log.syslog-rw-r--r--. 1 root root 27312 Jan 15 17:27 install.log-rw-------. 1 root root 1342 Jan 15 17:27 anaconda-ks.cfgdrwxr-xr-x 2 root root 4096 May 26 16:42 sbintomcat1:/root# exitlogoutConnection to 192.168.32.169 closed.---------------------------------------------------------------------tomcat1:/root/sbin# expect expect.exp spawn ssh root@192.168.32.171The authenticity of host '192.168.32.171 (192.168.32.171)' can't be established.RSA key fingerprint is da:3a:61:09:e4:f6:46:d7:01:08:1a:6c:b9:41:e8:4c.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '192.168.32.171' (RSA) to the list of known hosts.root@192.168.32.171's password: Last login: Mon May 25 15:09:25 2015 from 192.168.33.29flow:/root# ls -ltrtotal 44-rw-r--r--. 1 root root 7572 Jan 15 17:26 install.log.syslog-rw-r--r--. 1 root root 27312 Jan 15 17:27 install.log-rw-------. 1 root root 1342 Jan 15 17:27 anaconda-ks.cfgflow:/root# exitlogoutConnection to 192.168.32.171 closed.
0 0
- expect 使用说明
- Expect
- expect
- expect
- expect
- Expect
- expect
- expect
- expect
- expect
- expect
- expect
- expect
- expect
- expect
- expect
- expect
- expect
- 32位程序使用超过4G的内存 实例
- nginx配置conf文件URL匹配
- Java基础(极客)——19、Java面向对象之泛型(补充)
- int类型 10到99 阶乘结果为什么是0
- 自定义View中的onMeasure,onLayout,onDraw
- expect 使用说明
- Android Studio 自动检验代码
- 机房收费系统--需求文档
- 代码注入之远程线程篇
- mysql5.5主从服务配置
- UC:我们是怎么做出Chromium M35内核浏览器
- 【基础练习】codevs1506 传话题解
- Windows 内核(WRK)简介
- Hadoop Streaming