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.
Asked
Active
Viewed 98 times
0

Esp Esi
- 1
-
2... a perhaps closer duplicate How does a pipeline knows when to stop – steeldriver Mar 31 '23 at 12:24
-
Thanks, updated! – Stephen Kitt Mar 31 '23 at 14:03