Mailing List Archive

Support open source code!


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

Re: [tlug] random in bash [Kmail Notification]



>>>>> "Tod" == Tod McQuillin <devin@example.com> writes:

    Tod> On Thu, 7 Mar 2002, Shimpei Yamashita wrote:
    >> On Thu, Mar 07, 2002 at 07:15:33PM +0900,
    >> Antony Stace wrote:

    Tod> Here are some bash functions to produce (admittedly not very
    Tod> random) pseudo-random numbers:

If you're allowed to use tr(1), then head(1) should be OK?

head -10 /dev/random \
 | tr '\200-\377' '\000-\0177' \
 | tr --delete '\000-\0377\177'

Mere proof of concept, and I'm clearly doing something seriously bogus
(look really carefully at that last class).  (NB: /dev/urandom doesn't
help the bogosity.)

-- 
Institute of Policy and Planning Sciences     http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
              Don't ask how you can "do" free software business;
              ask what your business can "do for" free software.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links