Dan Jacobson said:

> (info "(coreutils) shuf invocation") says
>
>    These examples all have four input lines, so `shuf' might produce any
>    of the twenty-four possible permutations of the input.  In general, if
>    there are N input lines, there are N! (i.e., N factorial, or N * (N -
>    1) * ... * 1) possible output permutations.
>
> Please add an option to produce all permutations.
>
> Perhaps separated by blank lines or a --separator=...

I don't think it would be a good idea to implement this, since it would
only be usable for inputs with very few lines. Printing N factorial
different permutations gets unreasonable very quickly. A common example
is 52! for the number of unique ways that you can shuffle a deck of
cards:

    $ python3 -c 'import math; print(math.factorial(52))'
    80658175170943878571660636856403766975289505440883277824000000000000

And 52 lines is short relative to the number of lines that 'shuf' can
and is used to process.

Collin



Reply via email to