我已安装了TCL和EXPECT软件,expect在/usr/local/bin下,我写的sh程序不能运行,程序如下,文件名为:1.sh,请教:
#!/usr/local/bin/expect -f
spawn te.net 111.1.10.112
expect "login:"
send "root\r"
expect "password:"
send "111111\r"
send "ls -l\n"
#./expect 1.sh
程序运行到password处,就跳了出来,请教!!!!!
wwwzc 回复于:2004-11-16 17:39:05 |
#!/usr/local/bin/expect -f
spawn telnet 111.1.10.112 expect "login:" send "root\r" expect "password:" send "111111\r" interact |
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/