0

The command yes prints "y" on stdout forever. Head prints the first 10 lines of the input. Why yes stops when head stops ? I have my little idea but I'm just not sure so I ask here. To me the pipe creates a pipe and replace head stdin by the pipe input. Then when head ends, its program closes the pipe input and somehow the yes command notices it and decides it should stop too.

0 Answers0