>>>>> "JS" == Justin Shore <[EMAIL PROTECTED]> writes:

JS> What I don't know how to do is randomly pick a line from a file.  Like I
JS> said I'm doing this from the CLI where it only takes a nominal amount of
JS> shell scripting to have a working product in the end.  Any tips would be

/usr/games/random on BSD does this:

% man 6 random
NAME
     random - random lines from a file or random numbers

SYNOPSIS
     random [-er] [-f filename] [denominator]

DESCRIPTION
     Random 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 / denominator.  The default denominator for this mode of operation
     is 2, giving each line a 50/50 chance of being displayed.

So first you find out how many lines you have, determine how many you
want, then pick the right denominator.  Then pipe the output thru head
to get exactly 5000 lines.


-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to