GNU bug report logs - #54484
"sed -E" is not specified by POSIX

Previous Next

Package: sed;

Reported by: Keith Thompson <Keith.S.Thompson <at> gmail.com>

Date: Sun, 20 Mar 2022 21:37:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Keith Thompson <Keith.S.Thompson <at> gmail.com>
To: 54484 <at> debbugs.gnu.org
Cc: Keith Thompson <Keith.S.Thompson <at> gmail.com>
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.




This bug report was last modified 3 years and 84 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.