Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jan 2023 16:20:08 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 269250] split(1): auto-extend suffix length if required
Message-ID:  <bug-269250-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269250

            Bug ID: 269250
           Summary: split(1): auto-extend suffix length if required
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: jschauma@netmeister.org

I've just committed a change to NetBSD's split(1) to auto-extend the
suffix-length if needed:

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 lexica=
lly
and "cat *" would reproduce the input.  For example, splitting a 1M lines f=
ile
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.

The NetBSD diffs are here:
http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/split/split.c.diff?r1=3D1.2=
8&r2=3D1.29

http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/split/split.1.diff?r1=3D1.1=
5&r2=3D1.16

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-269250-227>