-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Description
csplit has multiple ways to split files: based on regex, line numbers and more. The examples in this issue use this file:
seq 1 50 > 50.txt
If we use multiple line numbers in the wrong order, we get an error (both in uutils and GNU):
> csplit 50.txt 20 10
csplit: line number '10' is smaller than preceding line number, 20
So far so good. But, if we use a regex first and then a line number that is smaller than the number of the line where the regex matched we get in trouble:
# GNU
> csplit 50.txt /10/ 5 --suppress-matched
18
0
117
# uutils
csplit 50.txt /10/ 5 --suppress-matched`
18
0
120
The reason is that we seem to make a distinction between the less than and the equal case to determine whether the line should bee suppressed, but GNU doesn't.
Found in #6114