[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#54484: "sed -E" is not specified by POSIX
From: |
Keith Thompson |
Subject: |
bug#54484: "sed -E" is not specified by POSIX |
Date: |
Sun, 20 Mar 2022 14:36:05 -0700 |
$ sed --version
sed (GNU sed) 4.8
...
GNU sed's "man" and "info" documentation both say that the "-E"
option is specified by POSIX. The man page says:
The -E option switches to using extended regular expressions
instead; it has been supported for years by GNU sed, and is now
included in POSIX.
The info documentation says:
'-E'
'-r'
'--regexp-extended'
Use extended regular expressions rather than basic regular
expressions. Extended regexps are those that 'egrep' accepts; they
can be clearer because they usually have fewer backslashes.
Historically this was a GNU extension, but the '-E' extension has
since been added to the POSIX standard
(http://austingroupbugs.net/view.php?id=528), so use '-E' for
portability. GNU sed has accepted '-E' as an undocumented option
for years, and *BSD seds have accepted '-E' for years as well, but
scripts that use '-E' might not port to other older systems. *Note
Extended regular expressions: ERE syntax.
The linked web page on austingroupbugs.net (which, BTW, should
probably specify "https" rather than "http") is an enhancement request,
originally submitted in 2011. It has "Resolution: Accepted As Marked"
and "Status: Applied", which certainly seems to imply that it's been
incorporated into POSIX, but The Open Group Base Specifications Issue 7,
2018 edition at
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html
doesn't mention the "-E" option.
- bug#54484: "sed -E" is not specified by POSIX,
Keith Thompson <=