I use read often in scripts to filter the right part into a variable like:
$ print "abc cde efg" | read k l ; print "k=$k, l=$l"
k=, l=
This works on linux and unix versions I work with. On OSX 10.4 this
doesn't work. I found a workaround but would like to know
why the original line fails. And I don't like the
$ print "abc cde efg" |& read -p k l ; print "k=$k, l=$l"
[1] 11299
k=abc, l=cde efg
Perderabo, what is strange is that when I start a different terminal, or
a different shell, they all behave the same. I tried bash, tcsh, csh and sh.
I expect it has to do with the OSX darwin or BSD system. Also commands
like ls and tar are different. It took me some time to get colors enabled
and app-defaults installed right for keybord shortcuts. The csh results:
$ csh
[d213-102-60-49:~] relyveld% echo "abc cde efg" | read k l ; echo "k=$k, l=$l"
csh: k: Undefined variable.
Finaly, I tried zsh and this one works! But I don't know zsh and all my
scripts are ksh based..