title: Pass a password to ssh in pure bash
body: <p>I want to pass a password to <code>ssh</code> using a bash script (Yes, I know that there are ssh keys that I could use, but this is not what I intend).</p>
  
  <p>I found some solutions that were using <code>expect</code> but since it is not a standard bash tool I am wondering if I can do this using pipes.</p>
  
  <p>Can someone explain to me, why exactly something like this:</p>
  
  <pre><code>echo "password\n" | ssh somehost.com
  </code></pre>
  
  <p>or</p>
  
  <pre><code>ssh somehost.com &lt;(echo "password\n")
  </code></pre>
  
  <p>doesn't work? Is there any possibility to make it work? Maybe executing <code>ssh</code> as a different process, obtaining its PID and then sending a string directly to it?</p>