groff
[Top][All Lists]
Advanced

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

Re: [Groff] [PATCH] Use bash for several contrib scripts


From: Tethys
Subject: Re: [Groff] [PATCH] Use bash for several contrib scripts
Date: Fri, 03 Jan 2014 00:06:31 +0000

Colin Watson writes:

>Perhaps just:
>
>  tmp=$d/eqn2graph$${$RANDOM:+-$RANDOM}
>
>then?

Since it's not guaranteed to be present, why not just ignore $RANDOM
and use our own randomly generated integer instead? Something like:

        groff_rand=$(dd if=/dev/urandom bs=8 count=1 2>/dev/null | sum | sed 
's/^0*//;s/ .*//')
        tmp="$d/eqn2graph$groff_rand"

should work and be portable. I think pretty much everywhere supports
/dev/urandom, right? If not we could use /dev/random with the minimal
chance of it blocking.

Tet



reply via email to

[Prev in Thread] Current Thread [Next in Thread]