Expect: getting out of control interact

October 2017


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" rapide.txt 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
Published by aakai1056. Latest update on October 13, 2010 at 04:51 AM by aakai1056.
This document, titled "Expect: getting out of control interact," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).