title: eof not recognized in Expect Script
body: <p>i have got some problems in my expect script.
  I am spawning a scp file upload but the eof is not recognized.
  The expect rans into the timeout before the script goes on.</p>
  
  <p>What am i doing wrong??</p>
  
  <p>Here is the script</p>
  
  <pre><code>    function ssh_upload_file () {
  
  test_log INFO "Uploading File $3 to Device $2 with a $1 seconds timeout" "ssh_upload_file"
  last_log_entry_to_detail
  
  expect &lt;&lt;- DONE
  set outfilename "$DETAIL_LOG"
  log_file "$DETAIL_LOG";
  
  set timeout $1
  set lantime_ip $2
  
  system "touch  ~/.ssh/known_hosts"
  system "ssh-keygen -R $2"
  spawn /bin/bash
  sleep 3
  send_user "Uploading File via SSH...\n"
  send "scp $2 $3:$4 || echo FWTEST_SSH_RESULT=\$?\n"
  expect "assword:" {
          after 1000
          send "$DUT_PWD\r"
          #set timeout 5
          #expect "y/n"
          #send "n\n"
          #set timeout $1
          #expect "#"
          #send "no_shell_timeout\n"
  }
  expect eof
  send_user "Done."
  log_file
  exit 0
  expect eof
  DONE
  LAST_ERROR=$?
  return $LAST_ERROR
  }
  </code></pre>