How does shell execute piped commands?

后端 未结 3 1840
Happy的楠姐
Happy的楠姐 2021-01-04 13:25

I want to understand that how does shell executes piped commands ? e.g. cat | more. I am aware that for executing a normal command shell does a fork, execute it and then ch

3条回答
  •  一整个雨季
    2021-01-04 14:25

    It sets up a pipe using the pipe system call, forks two processes instead of one and attaches one end of the pipe to the first process' stdout and the other end to the second process' stdin.

提交回复
热议问题