Page MenuHomeFreeBSD

split(1): auto-extend suffix length if required
Needs ReviewPublic

Authored by jschauma_netmeister.org on Jan 30 2023, 4:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 12, 3:09 AM
Unknown Object (File)
Feb 23 2023, 11:03 PM
Unknown Object (File)
Feb 4 2023, 3:59 AM
Unknown Object (File)
Jan 30 2023, 5:24 PM
Subscribers
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269250

If the input cannot be split into the number of files resulting from the default suffix length, automatically extend the suffix length rather than bailing out with 'too many files'.

Suffixes are extended such that the resulting files continue to sort lexically and "cat *" would reproduce the input. For example, splitting a 1M lines file into (default) 1000 lines per file would yield files named 'xaa', 'xab', ..., 'xyy', 'xyz', 'xzaaa', 'xzaab', ..., 'xzanl'.

If '-a' is specified, the suffix length is not auto-extended.

This behavior matches GNU sort(1) since around version 8.16.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped