简体   繁体   English

Expect脚本预期提示将作为输出的一部分出现

[英]Expect Script expected prompt coming as part of output

I have an expect script and user prompt is ">" . 我有一个期望脚本,并且用户提示符为“>”。 I create my script expecting ">" to send the next command, but unfortunately, ">" is also coming as part of the output received of the previous sent command, thereby causing my script to send the next command, how shoul I control when ">" coming as prompt and when as part of output? 我创建了脚本,期望“>”发送下一个命令,但是不幸的是,“>”也是上一个已发送命令的输出的一部分,从而导致我的脚本发送下一个命令,我应该如何控制何时“>”作为提示出现,何时作为输出的一部分出现?

也许像这样:

^\w+@\w+(\.\w+)?>$

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM