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

Re: dd if=/dev/zero of=testfile



on Fri, Dec 07, 2001 at 03:22:36PM +0700, Oki DZ (okidz@pindad.com) wrote:
> Hi,
> 
> How can I fill testfile with some random values? if=/dev/random?

Depends on the value of "value".

/dev/random sprays (high quality entropy) raw bits.

If you want to accumulate a set of numeric values, one approach might
be:

    while echo "$RANDOM" >> file; do :; done

...with more sophisticated loops suggesting themselves.

For more high-quality data, I'd recommend using the 'r-base' package,
though there's a bit of a learning curve.  Perl and Python have random
functions which could be used as well.

Peace.

-- 
Karsten M. Self <kmself@ix.netcom.com>       http://kmself.home.netcom.com/
 What part of "Gestalt" don't you understand?             Home of the brave
  http://gestalt-system.sourceforge.net/                   Land of the free
   Free Dmitry! Boycott Adobe! Repeal the DMCA! http://www.freesklyarov.org
Geek for Hire                     http://kmself.home.netcom.com/resume.html

Attachment: pgpoPhHS5l1co.pgp
Description: PGP signature


Reply to: