From 3a84293987bd21a92071a3d1c605ec9a2b3af1b4 Mon Sep 17 00:00:00 2001 From: Assaf Gordon Date: Thu, 4 Jul 2013 13:26:45 -0600 Subject: shuf: add --repetition to support repetition in output main(): Process new option. Replace input_numbers_option_used() with a local variable. Re-organize argument processing. usage(): Describe the new option. (write_random_numbers): A new function to generate a permutation of the specified input range with repetition. (write_random_lines): Likewise for stdin and --echo. (write_permuted_numbers): New function refactored from write_permuted_output(). (write_permuted_lines): Likewise. * tests/misc/shuf.sh: Add tests for --repetitions option. * doc/coreutils.texi: Mention --repetitions, add examples. * TODO: Mention an optimization to avoid needing to read all of the input into memory with --repetitions. * NEWS: Mention new shuf option. --- doc/coreutils.texi | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'doc') diff --git a/doc/coreutils.texi b/doc/coreutils.texi index b3233f602..ca10a16ff 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -4945,6 +4945,16 @@ commands like @code{shuf -o F