title: sftp put command fails when in shell script
body: <p>I am trying to make a shell script that creates a mysql dump and then puts it on another computer.  I have already set up keyless ssh and sftp.  They script below creates the mysql dump file on the local computer when it is run and doesn't throw any errors, however the file "dbdump.db" is never put on the remote computer.  If I execute the sftp connection and put command by hand then it works.</p>
  
  <p>contents of mysql_backup.sh</p>
  
  <pre><code>mysqldump --all-databases --master-data &gt; dbdump.db
  sftp -b /home/tim tim@100.10.10.1 &lt;&lt;EOF
  put dbdump.db
  exit
  EOF
  </code></pre>