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

Re: Needing a random number generator for scripting



On 27 Sep 2001, Jeremy Whetzel wrote:

> I'm in the process of writing up a script that I need to be able to
> "randomly" switch around the lines in a text file.  (ala a random mp3
> playlist) Would anyone have any suggestions?  I was originally thinking
> of using a random number generator for it, but if there's a tool that
> would work better...?

/dev/random gives random bits.  I don't know where it is documented.
There is a system call random() (see man 3 random).  You could write a
wrapper C program to use it in scripts.

--
#>!$!%(@^%#%*(&(#@#*$^@^$##*#@&(%)@**$!(&!^(#((#&%!)%*@)(&$($$%(@#)&*!^$)^@*^@)

	Tom "thriving on chaos" Peters
		NL-1062 KD nr 149	tel.    +31-204080204
 			Amsterdam	e-mail  tpeters@xs4all.nl



Reply to: