[Gllug] Imposing a delay in a pipeline

John G Walker johngeoffreywalker at yahoo.co.uk
Tue Apr 13 16:34:08 UTC 2010



On Tue, 13 Apr 2010 17:17:58 +0100 - Tethys <tethys at gmail.com> wrote:

> On Tue, Apr 13, 2010 at 5:12 PM, Andy Millar <andy at andymillar.co.uk>
> wrote:
> 
> > #!/bin/bash
> > while read line ; do
> >    ( sleep $1 ; echo $line ) &
> > done
> 
> With the amount of data I'm talking about, starting a new process per
> line would quickly bring the machine to its knees...
> 
> Tet
> 

In any case, that would put a 5 second minimum pause between each line,
which is not what you specified.

If you explained a bit more what you want to use this for then maybe
someone could use a bit of lateral thinking to solve your problem,

-- 
 All the best,
 John
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list