Bug 269521 - split(1): add '-c' to continue creating files
Summary: split(1): add '-c' to continue creating files
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-13 01:55 UTC by jschauma
Modified: 2023-02-13 02:00 UTC (History)
0 users

See Also:


Attachments
diff to split.c, split.1 (3.82 KB, patch)
2023-02-13 01:55 UTC, jschauma
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jschauma 2023-02-13 01:55:38 UTC
Created attachment 240121 [details]
diff to split.c, split.1

Currently, split(1) will clobber any existing output files:

$ split file; ls
xaa xab xac xad
$ split second-file; ls
xaa xab xac xad xae xaf

with files 'xaa' - 'xad' now having been overwritten.

I often would like for it to pick up where it left off and continue creating files in the sequence. Right now, there is no good way for me to yield the desired output of "xaa xab xac xad xae xaf xag xah xai xaj".

The attached diff adds a flag "-c" (mnemonic "create, don't overwrite" or "continue where you left off"):

$ split file; ls
xaa xab xac xad
$ split -c second-file; ls
xaa xab xac xad xae xaf xag xah xai xaj
Comment 1 jschauma 2023-02-13 02:00:24 UTC
See also: https://reviews.freebsd.org/D38553