demexp-dev
[Top][All Lists]
Advanced

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

Re: [Demexp-dev] Depencies of ocaml-gettext and other problems


From: GISQUET Christophe
Subject: Re: [Demexp-dev] Depencies of ocaml-gettext and other problems
Date: Sat, 23 Sep 2006 23:49:05 +0200
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

Good evening,

David MENTRE a écrit :
When I fall short of Navy commandos for breakfast, I usually have sed
scripts instead:
sed ':a; /^#:/N; s/\n#://; ta' <file>

Ouch, quite impressive! Patch applied but some explanation would be
nice. :-)

I was in no shape at the time of the initial posting anyway.

If I understood correctly:

 - put label "a";

 - for each line starting with "#:", add them to the "pattern space";

 - remove each pattern "\n#:";

 - branch to label "a" if previous substitution is successful.

Am I correct?

I have the same analysis. Of course, unmatching lines don't go through that pipeline.

To tell you the truth, it didn't miraculously end up my brain, but through repetitive head-banging against the well-known and nice sed FAQ:
http://www.dbnet.ece.ntua.gr/~george/sed/OLD/sedfaq.html

I hardly ever use labels, and I guess next time it will be of use, I'll probably have forgotten about them. There are so many ways to performs tasks using sed.

Best regards,
--
Christophe GISQUET




reply via email to

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