サーバーへのexpectスクリプトのssh-ingの出力の一部をログファイルに書き込もうとしています。
今、私はこのスクリプトを持っています:
#!/usr/bin/expect -f
spawn telnet 192.168.20.222
match_max 10000
expect "*?to continue*"
send -- "\r"
send -- "show interfaces 1 \r"
expect -- "*?2626#*"
send -- "show interfaces 2 \r"
expect -- "*?2626#*"
send -- "exit \r"
expect -- "*?2626>*"
send -- "exit \r"
expect "*?y/n*"
send -- "y \r"
show interfaces 1
と
からの応答だけをファイル「log.txt」に出力するように変更するにはどうすればよいshow interfaces 2
ですか?