title: expect script write to file partial output
body: <p>I am trying to write part of the output of an expect script ssh-ing to a server to a log file.<br>
  Now i am having this script:</p>
  
  <pre><code>#!/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&gt;*"
  send -- "exit \r"
  expect "*?y/n*"
  send -- "y \r"
  </code></pre>
  
  <p>How can i change it to output to a file 'log.txt' just the response from the <code>show interfaces 1</code> and 
  <code>show interfaces 2</code>   ?</p>