Any way to have flow control in bash pipe?

view full story

http://www.linuxquestions.org – Two processes are communicating through a pipe: A | B. A is writing data faster than B is reading it in. Is there any way to have A limit its writing rate to match B's reading rate? AFAIK the pipe will get full, and will make A's writing block, waiting for B to read in more data. But is there a way to limit A's writing rate before the pipe fills up? (In a way it's like having a pipe with a really small capacity, but as far as I know pipe capacity is a constant compiled into the kernel.) Code: EXAMPLE FOR CLARIFICATION while sleep 0. (HowTos)