I'm having a strange problem with a bash-script. The minimal code to reproduce it is here:
#!/bin/bash
function f() {
IFS=. read a b <<<"$1"
echo "a=$a b=$b"
}
f a.b
echo "inside echo: `f a.b`"
cat <<EOT
Inside heredoc: `f a.b`
EOT
The expected output is:
a=a b=b
inside echo: a=a b=b
Inside heredoc: a=a b=b
But I get:
a=a b=b
inside echo: a=a b=b
Inside heredoc: a=a.b b=
What am I missing here?
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.