我有一些问题,我的剧本,我想期待减号后预计发送命令show |比较成junos路由器。expect脚本(期望的Junos路由器显示减号|比较)
需要有人帮助我..
脚本
expect "#"
send "show | compare\r"
set total_error_minus 0
expect -- "-"
incr total_error_minus
示例结果
[edit]<br>
[email protected]_lab# show | compare<br>
[edit interfaces em0]<br>
- description B;<br>
+ description C;<br>
[edit interfaces em0 unit 1]<br>
- description A;<br>
+ description D;<br>
[edit]<br>
[email protected]_lab# <br>
如何检测和计数减演出结束后标志|使用expect脚本比较命令?
不要u需要发送'enter'关键?它不需要成为'send'show | compare \ r“'吗? – Dinesh
噢,我想我错过了把“\ r”,谢谢dinesh – IjanQlate