[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.
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.
$ uname -rs
$ /bin/sh -c 'echo $RANDOM'
$ /usr/xpg4/bin/sh -c 'echo $RANDOM'
$ /usr/bin/ksh -c 'echo $RANDOM'
sh-posix(1) in HP-UX 10.10 also mentions $RANDOM.
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
leafnode-list mailing list