linux – 如何使用Expect自动化telnet会话?

linux – 如何使用Expect自动化telnet会话?

我正在尝试编写一个expect脚本来自动执行telnet.这就是我到目前为止所拥有的. #!/usr/bin/expect# Test expect script to telnet.spawn telnet 10.62.136.252expect foobox login:send foo1rexpect Password:send foo2rsend ec