Deleted Added
full compact
13c13
< .\" must display the following acknowledgement:
---
> .\" must display the following acknowledgment:
33c33
< .\" $FreeBSD: head/games/random/random.6 79528 2001-07-10 10:42:19Z ru $
---
> .\" $FreeBSD: head/games/random/random.6 110723 2003-02-11 19:32:18Z seanc $
35c35
< .Dd March 31, 1994
---
> .Dd February 8, 2003
43a44
> .Op Fl f Ar filename
47,49c48,52
< reads lines from the standard input and copies them to the standard
< output with a probability of 1/denominator.
< The default value for
---
> has two distinct modes of operations. The default is to read in lines
> from stdin and randomly write them out to stdout with a probability of
> 1 /
> .Ar denominator .
> The default
51c54,55
< is 2.
---
> for this mode of operation is 2, giving each line a 50/50 chance of
> being displayed.
52a57,69
> The second mode of operation is to read in a file from
> .Ar filename
> and randomize the contents of the file and send it back out to stdout.
> The contents can be randomized based off of newlines or based off of
> space characters as determined by
> .Xr isspace 3 .
> The default
> .Ar denominator
> for this mode of operation is 1, which gives each line a chance to be
> displayed, but in a
> .Xr random 3
> order.
> .Pp
63a81,88
> .It Fl f Ar filename
> The
> .Fl f
> option is used to specify the
> .Ar filename
> to read from. stdin is used if the filename is set to "-".
> .It Fl l
> Randomize the input via newlines (the default).
67a93,108
> .It Fl u
> Tells
> .Xr random 6
> not to select the same line or word from a file more than once (the
> default). This does not guarantee uniqueness if there are two of the
> same tokens from the input, but it does prevent selecting the same
> token more than once.
> .It Fl U
> Tells
> .Xr random 6
> that it is okay for it to reuse any given line or word when creating a
> randomized output.
> .It Fl w
> Randomize words separated by
> .Xr isspace 3
> instead of newlines.
70c111,123
< .Xr fortune 6
---
> .Xr fortune 6 ,
> .Xr random 3
> .Sh BUGS
> There is no index used when printing out tokens from the list which
> makes rather slow for large files (10MB+). If this were used in
> performance sensitive areas, I'd do something about it. For smaller
> files, however, it should still be quite fast and efficient.
> .Sh HISTORY
> Original
> .Xr random 6
> game was brought in from BSD 4.4 Lite by jkh in 1994. The
> functionality to randomizing lines and words was added in 2003 by
> seanc.