> I don't think this functionality belongs in dash. For example, I
> find that the "sleep" command in
>
>> Example of a simple cronjob which runs with a random delay of
>> 0 ~ 327 seconds (to prevent network peaks of all the machines):
>>
>> */30 * * * * sleep $(($RANDOM/100)) && do_something_network_related
>
> is better written (more portably and more intuitively) as
>
> sleep $(awk 'BEGIN {srand(); printf "%d\n", rand()*327}')
>
> or
>
> awk 'BEGIN { srand(); system("sleep " int(rand() * 327)) }'
>
> even though this is a little longer.
nice idea...
*/30 * * * * perl -e "sleep rand(327)"; do_something_network_related
for the ones that like perl :-)
I think that is "dash" is supposed to replace bash, it should implement
$RANDOM... but this is only my personal opinion :-)
> On the other hand, I would definitely like a way for users to be able
> to easily choose a different shell to be used by cron, so they would
> be less at the mercy of the cruel sysadmin. What do you think?
If you put:
SHELL=/bin/something
at the begining of your crontab, all the lines will be run with your
prefered shell.
Thanks,
Pedro
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]