From: Randal L. Schwartz on
>>>>> "John" == John Kelly <jak(a)isp2dial.com> writes:

John> But I'm not sure I want to rely on an external utility. I'd rather do
John> it all in shell code. I could spend some time and write a shell RNG but
John> I was wondering if anyone has already implemented that wheel.

Since $RANDOM is already non-portable, what are you *really* saying?
How portable are you expecting to be?

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn(a)stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
From: John Kelly on
On Tue, 10 Aug 2010 20:53:25 -0700, merlyn(a)stonehenge.com (Randal L.
Schwartz) wrote:

>>>>>> "John" == John Kelly <jak(a)isp2dial.com> writes:
>
>John> But I'm not sure I want to rely on an external utility. I'd rather do
>John> it all in shell code. I could spend some time and write a shell RNG but
>John> I was wondering if anyone has already implemented that wheel.
>
>Since $RANDOM is already non-portable, what are you *really* saying?
>How portable are you expecting to be?

Only enough for the few platforms I'm using. I could do it with Perl
but I've already got this shell code and I don't want to rewrite it in
Perl. I just want to fix this one problem and move on.


--
Web mail, POP3, and SMTP
http://www.beewyz.com/freeaccounts.php

From: Dr J R Stockton on
In comp.unix.shell message <vilain-27F4D9.19413810082010(a)news.individual
..net>, Tue, 10 Aug 2010 19:41:38, Michael Vilain <vilain(a)NOspamcop.net>
posted:

>
>Why not make a directory with the hex representation of the UNIX
>localtime? That should never be the same. No looping required.

In many places, an hour of local time is repeated every Autumn; in one,
half that.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05.
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.
From: Wayne on
On 8/12/2010 11:50 PM, Michael Vilain wrote:
> In article <cbr2QMW3tEZMFwh$@invalid.uk.co.demon.merlyn.invalid>,
> Dr J R Stockton <reply1032(a)merlyn.demon.co.uk> wrote:
>
>> In comp.unix.shell message <vilain-27F4D9.19413810082010(a)news.individual
>> .net>, Tue, 10 Aug 2010 19:41:38, Michael Vilain <vilain(a)NOspamcop.net>
>> posted:
>>
>>>
>>> Why not make a directory with the hex representation of the UNIX
>>> localtime? That should never be the same. No looping required.
>>
>> In many places, an hour of local time is repeated every Autumn; in one,
>> half that.
>
> So use gmtime. That stays on GMT which doesn't vary.
>

That might work; but sadly there is no way (short of a C program)
to obtain localtime. I have tried for years to get the Austin
group to add "%s" to the standard for the date command, or to
specify that awk's srand() will return localtime (it just says it
uses "the time of day"). (If it were in the standard you could use
"awk 'BEGIN{srand(); print srand()}'".)

--
Wayne