Hide Forgot
The read command does not receive the data from a pipe, e.g. ksh-\1> echo "test" | read x ksh-\2> echo $x ksh-\3> read x test ksh-\4> echo $x test ksh-\5> As you see in the second attempt without the pipe, read gets the input string and assigns to variable x. Both will work on HP-UX and on SunOS.
This happens with bash too, FWIW.
It works with zsh - the author of pdksh is aware of the problem: http://www.cs.mun.ca/~michael/pdksh/
The author is of the opinion that this is undefined behaviour in the POSIX spec. Closing.
*** Bug 20097 has been marked as a duplicate of this bug. ***
*** Bug 3200 has been marked as a duplicate of this bug. ***
*** Bug 42720 has been marked as a duplicate of this bug. ***