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

后端 未结 4 2118
小蘑菇
小蘑菇 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:30

    I found this post after I ran into a race condition problem: sometimes the script completed as expected and other times it didn't. Adding a catch statement to the script ensured the desired outcome every time:

    [...]
    expect eof
    catch wait result
    

提交回复
热议问题