title: Strangeness in bash: different behaviour inside heredoc
body: <p>I'm having a strange problem with a bash-script. The minimal code to reproduce it is here:</p>
  
  <pre><code>#!/bin/bash
  
  function f() {
      IFS=. read a b &lt;&lt;&lt;"$1"
      echo "a=$a b=$b"
  }
  
  f a.b
  echo "inside echo: `f a.b`"
  cat &lt;&lt;EOT
  Inside heredoc: `f a.b`
  EOT
  </code></pre>
  
  <p>The expected output is:</p>
  
  <pre><code>a=a b=b
  inside echo: a=a b=b
  Inside heredoc: a=a b=b
  </code></pre>
  
  <p>But I get:</p>
  
  <pre><code>a=a b=b
  inside echo: a=a b=b
  Inside heredoc: a=a.b b=
  </code></pre>
  
  <p>What am I missing here?</p>
  
  <p>Update:
  the bash on my Mac (3.2.48) works as expected.
  the bash on my debian stable (4.2.37(1)-release) gives the described strangeness.</p>