random numbers in awk?

Martin Weitzel martin at mwtech.UUCP
Fri May 10 01:39:58 AEST 1991


In article <1991Apr24.041134.14519 at athena.mit.edu> jik at athena.mit.edu (Jonathan I. Kamens) writes:
>
>  [...] another possibility is
>to use the jot(1) program to generate a random number, if your system has jot.

SysV User's should note that they have a similar program, called random.
It's range of output values is restricted to 0..255 (the upper limit must
be specified as a calling argument). If you need larger numbers, you
can, of course, call random twice, multiply the result of the first
call by 256, add the result of the second call, and take the whole thing
modulo the largest number you want. 
-- 
Martin Weitzel, email: martin at mwtech.UUCP, voice: 49-(0)6151-6 56 83



More information about the Comp.unix.questions mailing list