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

To reply to this bug, email your comments to 54484 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-sed <at> gnu.org:
bug#54484; Package sed. (Sun, 20 Mar 2022 21:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Keith Thompson <Keith.S.Thompson <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-sed <at> gnu.org. (Sun, 20 Mar 2022 21:37:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Keith Thompson <Keith.S.Thompson <at> gmail.com>
To: bug-sed <at> gnu.org
Cc: Keith Thompson <Keith.S.Thompson <at> gmail.com>
Subject: "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.




Information forwarded to bug-sed <at> gnu.org:
bug#54484; Package sed. (Mon, 21 Mar 2022 20:46:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Keith Thompson <Keith.S.Thompson <at> gmail.com>
To: bug-sed <at> gnu.org
Cc: Keith Thompson <Keith.S.Thompson <at> gmail.com>
Subject: Re: bug#54484: "sed -E" is not specified by POSIX
Date: Mon, 21 Mar 2022 13:37:47 -0700
Quoting a discussion in comp.unix.shell:

Keith Thompson:
> The enhancement request was submitted in 2011.  The resolution is
> "Accepted As Marked" and the status is "Applied", so I'm not entirely
> sure what's going on.  But in any case, The Open Group Base
> Specifications Issue 7, 2018 edition doesn't mention "-E".

Geoff Clare:
> "Applied" means the edits have been made in the (troff) source of SUS.
> In this specific case the edit was applied long enough ago that it
> was included in the latest draft (2.1) of the next revision (Issue 8)
> that was made available to reviewers in August 2021.




This bug report was last modified 2 years and 247 days ago.

Previous Next


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