[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PCRE mode for sed
From: |
Christoph Anton Mitterer |
Subject: |
Re: PCRE mode for sed |
Date: |
Tue, 06 Nov 2012 00:58:07 +0100 |
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
Description: S/MIME cryptographic signature