当我这样做:
find . -name "pattern" | grep "another-pattern"
Run Code Online (Sandbox Code Playgroud)
是过程,find并且grep,催生了一起?我的猜测是肯定的.如果是这样,那么这是如何工作的?:
yes | command_that_prompts_for_confirmations
Run Code Online (Sandbox Code Playgroud)
如果yes不断向stdout发送'y'并在command_that_prompts_for_confirmations读取stdin时读取'y',那么如何yes知道何时终止?因为如果我yes单独运行而不将其输出传递给其他命令,它就永远不会结束.
但是如果管道命令不能同时产生所有进程,那么如何yes知道要输出多少?这对我来说是22.有人能解释一下这个管道在*NIX中是如何工作的吗?