4

我是第一次使用 autoexpect。我不确定使用它的参数应该是什么。我执行了 autoexpect 命令,并且有连续的消息“autoexpect 已启动,文件是 script.exp”。如果我执行 ssh 什么都不会发生。

autoexpect started, file is script.exp
autoexpect started, file is script.exp
autoexpect started, file is script.exp
autoexpect started, file is script.exp

谁能帮我解决这个问题。

提前致谢。

4

2 回答 2

2

autoexpect将根据您的操作创建一个可以重复使用的期望脚本。

这意味着,第一次您必须手动执行所有操作。下次您可以使用生成的文件script.exp重复相同的操作。您可以修改 script.exp 以使其更通用。

要退出自动预期,只需exit在所有操作完成后键入。

MBP:~ user$ ./autoexpect 
autoexpect started, file is script.exp
bash-3.2$ exit
exit
autoexpect done, file is script.exp
MBP:~ user$ 
于 2012-12-26T04:58:18.997 回答
0

我有同样的问题。我正在使用 bash 并且在 bash 中有很多初始配置。可能是一些启动配置 bash shell 影响了 autoexpect。我调用了 tcsh,然后调用了 autoexpect。autoexpect 在 tcsh 中运行良好,因为它没有任何启动配置。

调用 tcsh 并再次尝试。一旦我调用 tcsh 它就对我有用

于 2015-04-02T01:58:19.483 回答