[Gllug] Imposing a delay in a pipeline

Richard Huxton dev at archonet.com
Tue Apr 13 14:56:22 UTC 2010


On 13/04/10 15:00, - Tethys wrote:
> Does anyone know of a utility to impose a delay in a pipeline? I want to do:
>
> 	process_a | delay -5 | process_b
>
> such that process_b receives data 5 seconds after it was emitted by
> process_a. Any suggestions?

Initially I thought of something like:

perl -p -e 'sleep 1' | perl -p -e 'sleep 1' ...

Of course that's no good if you've got two lines per second after the 
first five.

So - what about:

perl -e 'sleep 5; print while (<>)'

-- 
   Richard Huxton
   Archonet Ltd
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list