Expect: getting out of control interact

Expect: getting out of control interact

Issue

I use the interactive controls and expect I will like to get out without interference. I arrived with timeout but it bothers me because I could interrupt my program, I can not get him out in other ways such

Interact eventually return

Don't work!

my script to launch:

# / Usr / bin / expect spawn telnet asus02 expect "login:" send "Log r" expect "password:" send "pwd r" expect ">" send "echo I'll get into the swing r" expect ">" send "lancementRhino.bat r" expect ">" send "echo I left the beat r" interact timeout 100 return exit

And in lancementRhino.bat:

echo mybat running cd "C: My Path" dir Rhino4 / runscript = "-_exit" rapidet mybat echo finished

Solution

Have you tried to "set timeout -1"(and deleting" interact "):

# / Usr / bin / expect

set timeout -1

spawn telnet asus02 expect "login:" send "Log r" expect "password:" send "pwd r" expect ">" send "echo I'll get into the swing r "expect"> "send" lancementRhino.bat r "expect"> "send" echo I left the beat r "exit

Spread the love

Leave a Comment