Pipelines in doubt UNIX

In the Unix programming environment, using K and P, it says that "The programs in the pipeline actually work at the same time, and not one after the other.
This means that the programs in the pipeline can be interactive:"

How can programs work at the same time?
For example: $ who | grep mary | wc -l
How will grep mary run until someone starts, or how does wc -l run until it runs know the results of previous programs?

+3
source share
1 answer
  • All three programs will start. grep and wc are waiting for input via stdin
  • who , grep
  • , grep stdout, wc
  • who grep ..

, , , .

+7

Source: https://habr.com/ru/post/1741245/


All Articles