Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csplit: --suppress-matched incorrectly elides last empty file #7286

Open
jfinkels opened this issue Feb 8, 2025 · 0 comments
Open

csplit: --suppress-matched incorrectly elides last empty file #7286

jfinkels opened this issue Feb 8, 2025 · 0 comments
Labels

Comments

@jfinkels
Copy link
Collaborator

jfinkels commented Feb 8, 2025

Environment: Ubuntu 24.04, uutils main branch (git commit d86a7fb), GNU coreutils v9.6.16-3f7c3-modified

Steps to reproduce:

seq 6 | csplit --suppress-matched - 2 4 6

What happens now: uutils csplit prints

2
2
2

and produces three files:

  • xx00 with contents 1\n,
  • xx01 with contents 3\n,
  • xx02 with contents 5\n.

What I expected to happen: GNU csplit prints

2
2
2
0

and produces four files:

  • xx00 with contents 1\n,
  • xx01 with contents 3\n,
  • xx02 with contents 5\n,
  • xx03, an empty file.

Notes: this is causing a failure in GNU test file tests/csplit/csplit-suppress-matched.pl.

@jfinkels jfinkels changed the title csplit: --supress-matched incorrectly elides last empty file csplit: --suppress-matched incorrectly elides last empty file Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant