aboutsummaryrefslogtreecommitdiff
path: root/coreutils/shuf.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* config: deindent all help textsDenys Vlasenko2017-07-211-1/+1
| | | | | | Those two spaces after tab have no effect, and always a nuisance when editing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Update menuconfig items with approximate applet sizesDenys Vlasenko2017-07-181-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: fix random line selection. Closes 9971Denys Vlasenko2017-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | """ For example, given input file: foo bar baz after shuffling the input file, foo will never end up back on the first line. This came to light when I ran into a use-case where someone was selecting a random line from a file using shuf | head -n 1, and the results on busybox were showing a statistical anomaly (as in, the first line would never ever be picked) vs the same process running on environments that had gnu coreutils installed. On line https://git.busybox.net/busybox/tree/coreutils/shuf.c#n56 it uses r %= i, which will result in 0 <= r < i, while the algorithm specifies 0 <= r <= i. """ Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix whitespacesManinder Singh2015-06-071-1/+1
| | | | | | | reported by script :- scripts/fix_ws.sh Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: trim help textDenys Vlasenko2014-03-071-4/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: do not use strings for -i RANGE caseDenys Vlasenko2014-03-071-3/+5
| | | | | | | function old new delta shuf_main 482 496 +14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: improve help textBartosz Golaszewski2014-03-071-3/+3
| | | | | Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: fix a segfault on 'shuf -e'Bartosz Golaszewski2014-03-071-1/+2
| | | | | Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: new appletDenys Vlasenko2014-03-051-0/+150
function old new delta shuf_main - 478 +478 packed_usage 29571 29719 +148 applet_names 2460 2465 +5 applet_main 1428 1432 +4 applet_nameofs 714 716 +2 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 4/0 up/down: 637/0) Total: 637 bytes Based on the code by Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>