| ▲ | brabel 2 hours ago | |
Wouldn’t the seq process keep writing to output until the output buffer of the pipe got full and then the next write would block and seq would just pause waiting for the write call to unblock? Or my understanding of piping is incorrect? | ||
| ▲ | syncsynchalt 25 minutes ago | parent | next [-] | |
What you've said is correct. The slide says something like "run the command `seq 2 10000000 | less` and check `ps`, notice that `seq` isn't running". But that isn't how the processes will behave, `seq` will continue running (albeit blocked) until `less` is dead or closes the pipe. | ||
| ▲ | js2 an hour ago | parent | prev [-] | |
Your understanding is correct. `seq` blocks when the pipe is full and is killed with SIGPIPE after `less` quits, closing the pipe. | ||