groff
[Top][All Lists]
Advanced

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

Re: [Groff] Line continuation


From: Ralph Corderoy
Subject: Re: [Groff] Line continuation
Date: Sun, 26 Oct 2008 11:27:38 +0000

Hi Miklos,

> >    $ sed ':l;/--$/{N;s/--\n *//;b l}' <miklos
>
> Since I need to do this thing far too many times, your idea of a
> preprocessor seems just great.  I don't know about sed but wrote a few
> scripts in perl (or Perl?), so  this would be an easy job.

Well, the sed script is simple enough.  If you do write your own in
Perl, look out for dealing with a string of continued lines, and also
handle a continuation at the end of the file.  My test file in the
earlier email had both.

To change the sed script to treat a backslash at the end of the line as
the continuation marker, you just need to be aware that it needs
escaping with another, like Perl.

    sed ':l;/\\$/{N;s/\\\n *//;b l}'

Cheers,


Ralph.





reply via email to

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