title: Why does "/dev/stdin" not exist when here-doc is used?
body: <p>I am using <code>git-bash</code>:</p>
  
  <pre><code>GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)
  </code></pre>
  
  <hr>
  
  <p>I declared the following simple function:</p>
  
  <pre><code>f() { local f=${1:-/dev/stdin}; sed 's/a/b/g' "$f"; }
  </code></pre>
  
  <p>When I use a pipe or a file to feed input to the function, everything works fine:</p>
  
  <pre><code>$ cat file
  a
  b
  c
  $ f file
  b
  b
  c
  $ printf 'a\nb\n' | f
  b
  b
  </code></pre>
  
  <p>But when I use a here-doc or a here-string, <code>/dev/stdin</code> seems not to exist:</p>
  
  <pre><code>$ f &lt;&lt; eof
  &gt; a
  &gt; b
  &gt; eof
  sed: can't read /dev/stdin: No such file or directory
  </code></pre>
  
  <p>Although, using <code>cat</code> with here-doc seems to work just fine:</p>
  
  <pre><code>$ cat &lt;&lt; eof
  &gt; a
  &gt; b
  &gt; eof
  a
  b
  </code></pre>
  
  <hr>
  
  <p><strong>This code works fine in my Linux distro.</strong> How could I change it so that it works with <code>stdin</code> or a file even in <code>git-bash</code>?</p>