Net :: Telnet ::思科无法在Perl中解析思科交换机中的提示

时间:2013-10-28 14:38:47

标签: perl switch-statement telnet router cisco

我正在尝试使用perl自动化交换机,但我无法解析特定命令的提示。我正在使用print和waitfor方法。

提示基本上是一条确认消息,我需要按Enter或按y。 这是提示

Clear "show interface" counters on this interface [confirm]

这就是我得到的错误

Can't parse prompt: '/Clear "show interface" counters on this interface [confirm]/' at access_endis.pl line 27

请帮忙。 我编辑了上面的提示,我得到一个像Timed out匹配提示的错误。

1 个答案:

答案 0 :(得分:0)

我尝试了以下声明,虽然它与提示符不符,但它对我有用。

  

$会话而> waitfor_pause(1);

实际上将覆盖cmd提示匹配,而是等待1秒。