[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[leafnode-list] Re: [PATCH] Random initial delay for fetchnews



On Thu, Jul 20 2006, Lloyd Zusman wrote:

> Reiner Steib <reinersteib+gmane@xxxxxxx> writes:
>> What's wrong with the following crontab entry?
>>
>> | */5 * * * * sleep $(($RANDOM % 60)); /usr/sbin/fetchnews
>
> I believe that it will only work if your shell is bash or zsh.

Yes, it's not present in every (bourne) shell, but in most of them[1].
If your cron shell doesn't have $RANDOM, you could use $$ or
/bin/bash -c 'sleep $(($RANDOM % 60))'.

My point is that I don't think that it's worth to add such an option
to fetchnews.  YMMV, of course.

Bye, Reiner.

[1]

$ uname -rs
SunOS 5.10
$ /bin/sh -c 'echo $RANDOM'

$ /usr/xpg4/bin/sh -c 'echo $RANDOM'
30812
$ /usr/bin/ksh -c 'echo $RANDOM'
31720

sh-posix(1) in HP-UX 10.10 also mentions $RANDOM.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

-- 
_______________________________________________
leafnode-list mailing list
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
https://www.dt.e-technik.uni-dortmund.de/mailman/listinfo/leafnode-list
http://leafnode.sourceforge.net/