title: How to send a command (to keep telnet session alive) while expect can get specific text?
body: <p>I have to save the output from a command from a 1980 telephony system (DMS100)in a file. I have an expect script to do this but my problem is the following:</p>
  
  <ol>
  <li>This command could output information for as much as 10 hours.</li>
  <li>For some reason after submitting my command my session gets closed after exactly 10 minutes.</li>
  </ol>
  
  <p>I need something like this: <a href="https://stackoverflow.com/questions/11797697/send-command-while-expect-can-get-specific-text">Send command while expect can get specific text</a></p>
  
  <p>But the difference is that my expect can come true after 10-12 hours AND my session expires every 10 minutes.</p>
  
  <p>I would like to send an invisible character while I expect for my string in order to keep my session alive. Something like this:</p>
  
  <pre><code>While expect "The End Of My Output"
  {
  send \007
  }
  </code></pre>
  
  <p>How can I do this?</p>
  
  <p>EDIT:</p>
  
  <p>My problem was that the telnet port I was using was configured with a 10 minute timeout. Found another port without a timeout and its working correctly.</p>