Re: Unifying BSD sed -E and GNU sed -r options?

Dan Kegel <[email protected]>
Newsgroups gmane.comp.gnu.utils.bugs
Message-ID <CAPF-yOZvibhE0RhJtUpN0kON5H4ZrTXj9R-wGBtuew-r4qj+hA@mail.gmail.com>
Right, but for now, I have to check platform before using it, e.g.

    case $_os in
    osx*) xregx=-E;;
    *) xregx=-r;;
    esac
    ... sed $xregx ...

I'd like it if either -r or -E worked on both gnu and bsd sed.
So this is a standardization enhancement request,
and it's possible bsd is the one that should change.
I have not yet done a search to see which of the two options
is used more in practice.


On Tue, Jan 21, 2014 at 11:08 AM, Davide Brini <[email protected]> wrote:
>> Dan Kegel wrote:
>
>> It'd be nice to be able to use extended regexps in script
>> run on both bsd and gnu.
>>
>> Has this issue been raised before? I couldn't find a bug tracker;
>> http://savannah.gnu.org/projects/sed doesn't list one.
>
> AFAIK, GNU sed has supported -E for quite some time (though it was, or perhaps it's still, undocumented).
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.