Home > other >  Is pipe in linux asynchronous or not?
Is pipe in linux asynchronous or not?

Time:09-18

I thought that when i running below commands

sleep 10 | sleep 2 | sleep 5   

Linux process will be

86014 ttys002    0:00.03 bash
86146 ttys002    0:00.00 sleep 10

when sleep 10 is end -> sleep 2 (when sleep 2 is end)-> sleep 5
that's i thought
But in Linux bash sleep 10, sleep 2, sleep 5 are in ps same time

Standard output of sleep 10 process will be redirected to sleep 5's process
But, in that case, sleep 5's process will be finished before sleep 10

I'm confused, any google keywords or concepts of that phenomenon?

(I'm not good at English, maybe it's hard to understand this text

  • Related