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
random number generator on porteus
- francois
- Contributor
- Posts: 6435
- Joined: 28 Dec 2010, 14:25
- Distribution: xfce plank porteus nemesis
- Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.
random number generator on porteus
Last edited by francois on 04 Jan 2014, 03:03, edited 1 time in total.
Prendre son temps, profiter de celui qui passe.
- francois
- Contributor
- Posts: 6435
- Joined: 28 Dec 2010, 14:25
- Distribution: xfce plank porteus nemesis
- Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.
Re: random number generator on porteus
There is:
http://www.cyberciti.biz/faq/bash-shell ... m-numbers/
http://www.cyberciti.biz/faq/bash-shell ... m-numbers/
So I got my answer.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:Code: Select all
$ od -vAn -N4 -tu4 < /dev/urandom
You can use /dev/random as follows:Code: Select all
2494028411
[/code]Code: Select all
$ od -An -N2 -i /dev/random Sample outputs: [code]62362
Prendre son temps, profiter de celui qui passe.
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: random number generator on porteus
You can use the built in bash variable $RANDOM
Code: Select all
echo $RANDOM
let x=( $RANDOM *42) && echo $x
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.