title: ssh-keygen accepting stdin
body: <p>I am trying to call <code>ssh-keygen</code> using a variable through <code>bash</code> as an input instead of a file to get a fingerprint of a public key.  I am aware that I could use a temp file to get around this issue, but for reasons out of scope of this question, I do not want to.</p>
  
  <p>This method does <em>not</em> work as it says the key file is invalid (it's correct for sure)</p>
  
  <pre><code>echo $pubkey | ssh-keygen -lf /dev/stdin
  </code></pre>
  
  <p>This <em>does</em> work, but is not using a variable, rather a file.</p>
  
  <pre><code>ssh-keygen -lf alpha.pub
  </code></pre>
  
  <p>This <em>does</em> work, but is not using a variable, rather a redirected file.</p>
  
  <pre><code>ssh-keygen -lf /dev/stdin &lt; alpha.pub
  </code></pre>
  
  <p>This does <em>not</em> work because I get an ambiguous redirect</p>
  
  <pre><code>ssh-keygen -lf /dev/stdin &lt; $(echo $pubkey)
  </code></pre>
  
  <p>I would appreciate some insight as to how to get ssh-keygen to read from a variable with a public key and if possible, an explanation as to why the redirects aren't doing what I think they should be doing.  In specific why the <code>|</code> behaves differently than the <code>&lt;</code> and why the third example is an <code>ambiguous redirect</code>.  I searched online but many of the redirect tutorials didn't seem to answer my questions.</p>