Page 1 of 1
random number generator on porteus
Posted: 03 Jan 2014, 14:41
by francois
Is there a random number generator on porteus? If yes, how come there is nothing in /dev/random or /dev/urandom?
I need to know that in relation to a program that I tried to build: qpdf. During buildup it said that /dev/random or /dev/urandom were not available.
Thanks
Re: random number generator on porteus
Posted: 04 Jan 2014, 03:01
by francois
There is:
http://www.cyberciti.biz/faq/bash-shell ... m-numbers/
Using /dev/urandom or /dev/random
The character special files /dev/random and /dev/urandom provide an interface to the kernel's random number generator. You can use /dev/urandom as follows:
Sample outputs:
You can use /dev/random as follows:
Code: Select all
$ od -An -N2 -i /dev/random
Sample outputs:
[code]62362
[/code]
So I got my answer.
Re: random number generator on porteus
Posted: 21 Jan 2014, 13:55
by brokenman
You can use the built in bash variable $RANDOM
Code: Select all
echo $RANDOM
let x=( $RANDOM *42) && echo $x