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" 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

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
Related
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).