#1029335 coreutils: csplit: regexes don't match literal newline at the end, must do so per POSIX and for portability

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
наб
Date:
2023-01-21 12:15:04 UTC
Severity:
normal
#1029335#5
Date:
2023-01-21 12:13:03 UTC
From:
To:
Dear Maintainer,

POSIX requires that each line be matched by BREs per spec
(i.e. without REG_NEWLINE); I consider this to be a bug:
https://www.mail-archive.com/austin-group-l@opengroup.org/msg10621.html
Nevertheless, there are systems that agree (all berkeley implementations),
and this is the letter of the standard. Therefore, the /only/ portable way
to match an end-of-line is
  $ seq 9 | csplit - '/8
  /'
  14
  4

coreutils provides an extension that allows that to be spelled '/8$/',
as does the illumos gate.

However, coreutils /rejects/ the portable spelling!
  $ seq 9 | csplit - '/8
  /'
  csplit: ‘/8\n/’: match not found
  18
which is wrong.

наб