How to wait for a process to complete using tcl-expect

后端 未结 4 2127
小蘑菇
小蘑菇 2021-02-15 18:12

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

4条回答
  •  故里飘歌
    2021-02-15 18:42

    you're forgetting to "hit enter". After sending exit, the way to wait for the process to end os expect eof:

    send "source xyz.csh\r"
    expect "%"
    send "exit\r"
    expect eof
    

提交回复
热议问题