1
スイッチに関連付けられたすべてのmac-addressを含むリストをファイルに入れるためのexpectスクリプトがあります。複数の出力ページを処理するEXPECTスクリプト
#!/usr/bin/expect -f
spawn telnet 192.168.20.222
match_max 10000
expect "*?to continue*"
send -- "\r"
send -- "show mac \r"
expect -- "*?2626#*"
send -- "exit \r"
expect -- "*?2626>*"
send -- "exit \r"
expect "*?y/n*"
send -- "y \r"
このようにいろいろ書いそれはすべて正常に動作しますが、あまりにも多くのアドレスがある場合、スイッチは言うだろう: - MORE -
、次のページ:スペース、次の行を:終了し、入力します。 Control-C
もちろんN個のページがあり、N beeingは不明です。
どうすればよいですか?