title: How to find if a file exists in expect script
body: <p>I have a statement inside my expect script like this</p>
  
  <pre><code>send "sed -i -e 's/$oldport/$newport/' backup.txt\r"
  expect "$ "
  </code></pre>
  
  <p>However I wish to first check whether the file backup.txt exist and if it does, then edit it.</p>
  
  <p>How do I acheive this?</p>
  
  <p>Thanks</p>