title: SFTP command in Bash script with Mac OS X
body: <p>I need to transfer a text file to a remote PC (freeSSH) using SFTP and SSH from a Mac host. These two are connected in a local network. </p>
  
  <p>So is there a way to run an SFTP command (with the username and password provided) from inside the Bash script?</p>
  
  <p>I already tried some scripting with <code>expect</code>, but I didn't get any results.</p>
  
  <p>I found a similar post, <em><a href="https://stackoverflow.com/questions/5386482/how-to-run-sftp-command-with-a-password-from-bash-script">How to run the sftp command with a password from a Bash script</a></em>, but it is for Linux. I have a Mac.</p>