ChinaUnix.net
相关文章推荐:

expect

我在使用expect 执行sed -i 的时候, 总是报错无法执行, 请大家帮我分析下, 谢谢。具体的语句是这样的, expect "*#" send "sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/sysconfig/selinux\r" 提示的错误是这样的 send: spawn id exp6 not open while executing "send "sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/sysconfig/selinux\r"" (file "./test.exp" line 14) 请大家帮我看看谢谢

by 人生高地 - 监控及自动化运维技术 - 2012-12-07 16:33:21 阅读(1741) 回复(3)

相关讨论

写了一个expect通过ssh登陆到远程主机的脚本,但是登陆成功后自动断开,怎么做才能使保持会话那

by mengchang_cu - Shell - 2012-02-02 17:29:38 阅读(1085) 回复(3)

expect <expect { "*(yes/no)?*" {send -- "yes\r"; exp_continue} "*password:*" {send -- "kjk123\r"} } send "touch a b c d e\r" send "exit\r" ! 为什么 在10.10.17.3 机器上没建立起来呢

by 267020090 - Shell - 2011-06-21 19:01:27 阅读(1946) 回复(8)

想请教一个问题,在expect里面怎样调用shell脚本

by wtuter - Shell - 2008-10-31 10:00:18 阅读(1537) 回复(0)

 以前装的fc4自己在装系统 的过程中装了expect , 现在的系统 没有,只好自己下了装,  装完,装前几次老是出问题,最好装好,担心自己以后忘记了,就写下来在这里   先下载  ,是在 chinaunix下载的        三个包  : tcl8.4.13-src.tar.gz tk8.4.13-src.tar.gz expect-5.37.1.tar.gz 装 tcl .解压就不说了,就 一个 configure 前面加参数  ...

by achlice - Linux文档专区 - 2007-11-13 17:08:37 阅读(781) 回复(0)

是否能下列x.x.x.x利用變數的方式 讀入例如/ETC/HOSTS 分別登入不同台SERVER 執行COMMAND #!/usr/bin/expect spawn telnet x.x.x.x expect "login:" send "pom\r" expect "Password:" send "123456\r" expect "$" send "cd /home/p ...

by 68930089 - Shell - 2006-08-15 23:47:56 阅读(1118) 回复(1)

请问一下: 我的机子不能用expect,要使用expect,必须安装Tcl,Tcl是个什么东西啊?全称是什么? 谢谢!!

by tyffly - Shell - 2003-07-10 18:13:23 阅读(940) 回复(3)

请问一下: 要使用expect,必须安装Tcl,Tcl是个什么东西啊?全称是什么? 谢谢!!

by tyffly - 其他UNIX - 2003-06-30 13:09:44 阅读(829) 回复(0)

现在有这样一个需求,ssh nnn@ip 如果远程能登陆就算成功,如果弹出Token: 就记录这个远程ip,放在失败列表里。脚本不知道怎么写。 #!/usr/bin/expect -f set ip [ lindex $argv 0 ] set timeout 6 spawn ssh nnn@$ip -q expect { "*yes/no" { send "yes\r"; exp_continue} "*as*ord:" {send "nnn\r"} warning* {send "exit\n} } send "/sbin/ifconfig eth1\r" send "exit\r" expect ...

by daxuewuhen2014 - Shell - 2014-05-27 09:28:52 阅读(3200) 回复(29)

expect 学习 example spawn telenet IP expect "login:*" send "user\r" expect "password:*" send "123456\r" sleep 5 send "service XXXXX start" # =>假如这个命令执行时间长,命令结果不知道。不用expect , sleep,能不能用wait等待服务启动完成,再查状态。 wait #<= wait 行吗 send "service XXXXX status" #查服务启动状态 expect eof

by lll0024 - Shell - 2013-09-10 16:12:29 阅读(6510) 回复(7)

expect -c " spawn scp -P $port /root/.ssh/authorized_keys2 /root/wlx/remote_operate.sh root@$ip:/tmp/ expect { \"*yes/no*\" {send \"yes\r\"; exp_continue} \"*password*\" {send \"OL_\"pB%39n3L\r\"} } 报错: root@xxxxxxxxxxxx's password: extra characters after close-quote while executing "send "OL_"pB%39n3L\r"" invoked from within "expect { ...

by aa673 - Shell - 2013-08-13 09:02:42 阅读(4601) 回复(6)