bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] Magic sed expr


From: Sergey Poznyakoff
Subject: Re: [bug-mailutils] Magic sed expr
Date: Mon, 02 Feb 2004 10:44:25 +0200

Hi Linus,

> The sed expression in doc/texinfo/Makefile.am is truly neat.
> Nevertheless does non-GNU seds dislike it deeply.  

Oh, I see, that's because traditional seds require a newline before
a closing brace. Rewriting it as follows should work:

1{s/\/\*/@comment  /
b
}
2,/.*\*\//{s/\*\///;s/^/@comment/
b
}
s/\([{}]\)/@\1/g

(You'll have to put it into a separate script, since make will not allow
embedded newlines in a command, and replace the Makefile.am rule with
.c.inc:; sed -f SCRIPT_NAME $< > $@). Please let me know if it works, so
I update the CVS accordingly.

> Would it be ok to replace it with running awk?

I guess sed is better and simpler. After all, both sed and awk will
require a separate script, so we won't gain anything by using awk
(except producing extra memory hog).
   
Thanks.

Sergey

PS: By the way, did you receive my last email? It seems that undelivery
of my letters is becoming proverbial, doesn't it?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]