So in my shell i execute:
{ while true; do echo string; sleep 1; done } | read line
This waits one second and returns.
But
{ while true; do /bin/echo string; sleep 1; done } | read line
continues to run, and doesn't stop until i kill it explicitly.
I have tried this in bash as well as zsh, but the behaviour is the same. I wonder, why do these statements execute in such different manner? I understand, that in the first case right part of the pipe finishes after reading single line from its stdin, and terminates. Consequently, the interpretor terminates the whole pipe. But why does this scenario not apply to the second case?..