2 ms·
GNU coreutils' shuf since v8.22 (Dec 2013) implements this to minimize memory usage when sampling large files or unknown numbers of items read from a pipe. For
by pixelbeat 11y ago
GNU coreutils' shuf since v8.22 (Dec 2013) implements this to minimize memory usage when sampling large files or unknown numbers of items read from a pipe.
For example this command never finishes, but consumes a constant (small) amount of mem.
seq inf | shuf -n1