View Single Post
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#111
ehm... this line is ONLY for generating a RANDOM number (because $RANDOM doesn't seem to work).

it makes a copy (dd) of /dev/urandom but only of the first block (count 1) and deletes the rest (2> /dev/null).
because urandom doesn't only consists of numbers - but we want a number/integer - you have to change this using the checksum (cksum).
but this checksum is way too long so we are cutting (cut) it off. (:

i'm only searching for another way of getting randomness in my script on startup.
i tried it with rn=$(date +%S) which saves only the seconds of the current timestamp in rn... but on startup date-command only counts up and doesn't show the actual time
so i'm only getting 1 and 2... -.-

i've been searching google for the last few hours... but i can't find anything useful...

btw: i'm awake for over 40 hours... my eyes are bloody-red... so i'll go in my bed now ^^

if somebody knows a solution for getting a random number at startup... please post

good night. (: