I am writing a script using expect in which I have to rlogin to some host & after that I need to send some commands. Now I want to exit to that host and relogin again to som
Can you elaborate on "still script sending rest of the commands in between the previous process. "
I tried this and it worked.
spawn ssh host1 expect ":" send pwd1 expect "%" send "echo hi\r" expect "%" send "exit\r" expect eof spawn ssh host2 expect ":" send pwd2