Why doesn't yes | head
hang?
I thought the system collects all of the result from yes
and then pipes it to head
, and because yes
is an infinite loop, the system hangs. But, it can actually stop and show 10 lines of y
.
How does the system manage to stop yes
when head
is done collecting data?