When I do this:
find . -name "pattern" | grep "another-pattern"
Are the processes, find
and grep
, spawned together? My guess is yes. If so, then how does this work?:
yes | command_that_prompts_for_confirmations
If yes
is continuously sending 'y' to stdout and command_that_prompts_for_confirmations
reads 'y' whenever it's reading its stdin, how does yes
know when to terminate? Because if I run yes
alone without piping its output to some other command, it never ends.
But if piping commands don't spawn all the processes simultaneously, then how does yes
know how many 'y's to output? It's catch-22 for me here. Can someone explain me how this piping works in *NIX?