.Dd 2007-11-25 .Dt UNSORT 1 .Os "Free Software" .Sh NAME .Nm unsort .Nd reorder lines in a file in semirandom ways .Sh SYNOPSIS .Nm .Op Fl hvrpncmMsz0l .Op Fl Fl help .Op Fl Fl version .Op Fl Fl random .Op Fl Fl heuristic .Op Fl Fl identity .Op Fl Fl concatenate .Op Fl Fl merge .Op Fl Fl merge-random .Op Fl Fl seed Ar integer .Op Fl Fl zero-terminated .Op Fl Fl null .Op Fl Fl linefeed .Op Ar file No ... .Sh DESCRIPTION .Nm prints the lines in the input files (or standard input) in semi-random order. Available algorithms are a Mersenne Twister based PRNG and a heuristic algorithm that aims to create a subjective even distribution. .Ss Command line options .Bl -tag -width indent .It Fl h, Fl Fl help Display a concise summary of the available options and argument syntax. .It Fl v, Fl Fl version Display version and copyright information. .It Fl r, Fl Fl random Use the Mersenne Twister based randomization algorithm. .It Fl p, Fl Fl heuristic Use the heuristic "shuffling" algorithm which permutes the lines in such a way that they're spread more or less evenly in the output. This is the default. .It Fl n, Fl Fl identity Do not reorder lines in the input. Useful if you just want to merge the files. .It Fl r, Fl Fl concatenate Concatenate all input files then apply the shuffling algorithm to the result as a whole. .It Fl m, Fl Fl merge Shuffle all input files seperately then merge the result. Equal-sized files will be merged in the order in which they appear on the command line. .It Fl M, Fl Fl merge-random Shuffle all input files seperately then merge the result. Equal-sized files will be merged in random order. This is the default. .It Fl s, Fl Fl seed Ar integer Use this integer as a seed, instead of random data from the environment. .It Fl z, Fl Fl zero-terminated, Fl 0, Fl Fl null Lines are terminated with a \\0 character. .It Fl l, Fl Fl linefeed Lines are terminated with a \\n character. This is the default. .El .Sh SEE ALSO .Xr sort 1