coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: csplit: split file is created if input is empty


From: Pádraig Brady
Subject: Re: csplit: split file is created if input is empty
Date: Thu, 9 Jan 2025 19:36:59 +0000
User-agent: Mozilla Thunderbird Beta

On 09/01/2025 15:34, Daniel Hofstetter wrote:
Hi,

While experimenting with csplit I noticed the following behavior: if
the input is empty, an empty xx00 split file is created:

$ printf "" | csplit - 5
csplit: input disappeared
$ ls xx00
xx00

However, if the input is not empty, no such file is created:

$ printf "a" | csplit - 5
csplit: ‘5’: line number out of range
1
$ ls xx00
ls: cannot access 'xx00': No such file or directory

Is this a bug or a feature?

Looks like a bug.
I can't think why the "input disappeared" case is handled separately.
I'll push the attached later to treat it like the second case above.

cheers,
Pádraig

Attachment: csplit-empty.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]