Re: PCRE mode for sed

Christoph Anton Mitterer <[email protected]>
Newsgroups gmane.comp.gnu.utils.bugs
Message-ID <[email protected]>
On Mon, 2012-11-05 at 18:12 -0500, John Cowan wrote:
> How about packaging a psed that always uses PCREs?  That way, there's
> no problem with standardization:  sed is sed, psed is not.
Sounds fine in principle...

From the user side I'd even like that more, as psed is shorter than sed
-P.
Actually I always have a alias pgrep="grep -P" definition.


From a technical side I'd consider it less beautiful... another binary
doing rather the same than sed already does,... with similar
interface/options. There's always the chance that changes to one won't
hit the other.
But that's a matter personal taste I guess.


Maybe a third solution could be considered:
- Put the "main code" for supporting PCRE into the sed binary,
supporting builds with static/dynamic linking and with dlopen (perhaps
the one can avoid major problems by looking at how problems were solved
with grep).

- Adding a psed binary (or actually a symlink should be enough), which
is only created when PCRE support is available (guaranteeing that, would
again be the job of the distro) and automatically implies -P
Has the advantage that scripts could check for psed and use it only when
it exists.


Cheers,
Chris.
smime.p7s (application/x-pkcs7-signature, 5 KB) - not displayed
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.