[Gllug] Delayed data feed

salsaman at xs4all.nl salsaman at xs4all.nl
Thu Jan 13 13:11:09 UTC 2011


On Thu, January 13, 2011 03:03, Andrew Farnsworth wrote:
> On Wed, Jan 12, 2011 at 8:44 PM, Justin Perreault
> <justinperreault at dl-jp.com
>> wrote:
>
>> On Wed, 2011-01-12 at 16:33 +0000, - Tethys wrote:
>> > Does anyone know of a simple delay utility that consumes data from
>> > stdin and outputs it on stdout a fixed time later? What I want to be
>> > able to do is:
>> >
>> >       mkdata | delay 30 | send_data_to_customer
>>
>> Based on what I have read I am wondering if the issue is the "|"
>>
>> echo "hello1"; sleep 30s; echo "hello2"
>>
>> gives a 30s delay(rough count on 1 one thousand) between the two lines
>> so how about
>>
>> mkdata > custfile1 ; sleep 30s; send custfile1 to customer
>>
>> or does the creation of the file get in the way? Don't even know if it
>> is needed to be honest, just did not see anyone mention the "|" you are
>> using.
>>
>
> There are several problems here.  What happens if the mkdata function
> either, doesn't exit or is called again before the 30s has expired and
> overwrites the custfile1 data file (yes, you can increment the 1 each time
> but it needs to be said).  Other issues to, we need more information on
> what
> is happening.
>
> Andy
> --
> Gllug mailing list  -  Gllug at gllug.org.uk
> http://lists.gllug.org.uk/mailman/listinfo/gllug
>



How about this:

if mkdata is using echo to output, create a new command, eg.
/usr/local/bin/echodelay

  sleep 30
  echo $@

then:

alias echo=/usr/local/bin/echodelay

and adjust it somehow so that echodelay gets run in the background.



Salsaman.



-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list