获得期望进行交互,直到程序终止

时间:2022-02-27 20:30:28

I am using the Expect Linux tool and I have to interact with the shell. However, it's not a true interact, I just want to see what's going on. How can I get Expect to exit after the interacting program exits?

我正在使用Expect Linux工具,我必须与shell进行交互。然而,这不是真正的互动,我只是想看看发生了什么。在交互程序退出后如何让Expect退出?

1 个解决方案

#1


Never mind, I found it.

没关系,我找到了。

interact $

Will cause expect to exit when it encounters the string $.

当遇到字符串$时会导致退出。

#1


Never mind, I found it.

没关系,我找到了。

interact $

Will cause expect to exit when it encounters the string $.

当遇到字符串$时会导致退出。