[Gllug] Imposing a delay in a pipeline

Andy Millar andy at andymillar.co.uk
Tue Apr 13 16:12:18 UTC 2010



On Tue, 2010-04-13 at 17:05 +0100, Andy Millar wrote:
> On Tue, 2010-04-13 at 16:07 +0100, Richard Huxton wrote:
> > Actually, that's not going to work either, is it?
> 
> #!/bin/bash
> while read line ; do
>     echo $line
>     sleep $1
> done

Nope, I've just been reliably informed that that doesn't work, so you
could probably :

#!/bin/bash
while read line ; do
    ( sleep $1 ; echo $line ) &
done

Andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5162 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20100413/ef18753e/attachment.bin>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list