Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Replacing sed for zsh portability
- X-seq: zsh-users 9323
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxxxxx>
- Subject: Re: Replacing sed for zsh portability
- Date: Tue, 16 Aug 2005 18:18:14 +0200
- In-reply-to: <20050816155114.GA1854@DervishD>
- Mail-followup-to: Zsh Users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20050815103557.GA1411@DervishD> <20050816154033.GY10992@xxxxxxxxxxxxx> <20050816155114.GA1854@DervishD>
On 2005-08-16 17:51:14 +0200, DervishD wrote:
> The thing is perfectly suitable to be done in sed, in fact it is
> a one-liner (three lines if non-GNU sed), and it can even be done in
> one or two lines in Zsh. Introducing a dependency with Perl just for
[...]
The problem with sed is that it is non-portable, and it is difficult
to be sure that a sed call will work as expected on any machine.
With zsh, things related to regexp are difficult to read, and the
behaviour often depends on options (one needs to remember to use
"emulate -LR zsh", and this should be OK, however).
I've had to switch to Perl for a simple replacement just because
in-place editing with sed isn't supported everywhere, and when it
is supported, it doesn't behave in the same way on every machine.
Though this is in a zsh function, I haven't tried with zsh.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
Messages sorted by:
Reverse Date,
Date,
Thread,
Author