title: Send password when using scp to copy files from one server to another
body: <p>using scp to copy files from 1 unix server to another regularly and performing certain actions. to do this quickly I wish to use a unix script which does the scp and inputs the password required to complete the scp.</p>
  
  <p>I have tried the expect command to send the password throught the unix command line however unable to achieve this so far.</p>
  
  <p>sample commands</p>
  
  <pre><code>scp ./abc.txt hostname/abc.txt
  expect "*password:*"
  send "mypassword\r"
  </code></pre>
  
  <p>I get these errors:</p>
  
  <pre><code>couldn't read file "password: ": no such file or directory
  myscript.sh[5]: send: not found [No such file or directory]
  </code></pre>
  
  <p>am I missing something?</p>