Skip to content

ibara/shuf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shuf

shuf is a utility that outputs a random permutation of its input lines.

It is an ISC licensed reimplementation of the shuf(1) utility from GNU coreutils.

Usage

shuf [-hv] [-n count] [-o outfile] [-rz] [file]
shuf [-hv] -e [-n count] [-o outfile] [-rz] [args ...]
shuf [-hv] -i lo-hi [-n count] [-o outfile] [-rz]

See shuf.1 for more details.

Dependencies

Because of its use of OpenBSD arc4random_uniform(3), getprogname(3), reallocarray(3), and strtonum(3), non-*BSD users may need to install libbsd to compile shuf.

configure will figure this out for you.

Compiling

./configure
$ make
$ sudo make install

Reporting bugs

Patches always welcome.

shuf should not crash on any input. shuf has been extensively fuzzed with afl-fuzz but more testing is always better. Please file a bug report with crashing input if you find any.

shuf should perfectly mimic GNU shuf behavior, with minimal exceptions. Two notable exceptions are better error messages and more strict getopt handling. If you discover any areas where shuf does not mimic GNU shuf, please file a bug report.

License

ISC license. See LICENSE for details.

Download

Tarballs are available under the Releases tab. Please use the versioned tarball instead of the auto-generated tarballs.

Source code

Source code is hosted on GitHub: https://github.com/ibara/shuf