Shell script successful telnet login, how to issue commands after that?
问题 #!/usr/bin/expect -f spawn telnet 10.21.0.17 expect -re "login" send "admin\n" expect -re "Password" send "supersecurepassword\n" interact works as expected. Upon running the script I am logged in to whatever telent IP I used in the line spawn telnet 10.21.0.17 Then it drops me to the Shell of the AP WAP-> How do I issue further commands? I'd like to issue reboot and then maybe a sleep 20 and finally exit . I have tried using echo and expect with no success. I've also tried with removing the