title: How to configure timeout in expect script with Cygwin?
body: <p>I am transferring some files using sftp. My source system is a ubuntu system while the destination is windows. And I have installed Cygwin software in windows for sftp and ssh. I have    the script as follows...</p>
  
  <pre><code># FILE: test1.exp
  
  set sftp_HOST somehost
  set sftp_user someuser
  set sftp_password somepassword
  spawn sftp $sftp_user@$ftp_HOST
  expect "*Password:* "
  send "$sftp_password\r"
  expect "sftp&gt;* "
  send "cd files\r"
  expect "sftp&gt;* "
  send "mput *.xlsm\r"
  expect "sftp&gt;* "
  send "quit\n"
  expect eof
  </code></pre>
  
  <p>This script works fine. but at the middle some files not transferred properly. Due to timeout, other command continues from my shell script.</p>
  
  <p>I am calling the above expect from below script...</p>
  
  <pre><code># FILE: testscript.sh
  
  export TELNET_PATH="/home/ist/Desktop/shellfilesscript"
  expect $TELNET_PATH/test1.exp
  cp *.xlsm /testfolder
  </code></pre>
  
  <p>For example, when running the test1.exp the cp command starts automatically and interrupts the expect command. I can't find any solution from previous posts, I think there is some        different way for cygwin. Help is appreciated.
  Thank You</p>