Skip to Content.
Sympa Menu

baslinux - Re: [BL] Man2text2 Sed Scripts for Nroff

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: "David Moberg" <davidjmoberg AT gmail.com>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] Man2text2 Sed Scripts for Nroff
  • Date: Fri, 5 Jan 2007 15:06:05 -0800

Lee Forrest wrote:
This is from the sed&awk book. I haven't tested it
because the only manpages I have are not in nroff.

s/.^H//g
s/^[9//g
s/^[ ^I]*//g
s/^I/ /g

This removes the non-printing characters or replaces them with spaces?
That will extract plain text, I think. Is there an easy way to use
ANSI escape sequences (for colors, bold, highlighting)? Perhaps a
separate script could handle those.

[troff]
I wrote a crude script using sed that reformats them, and will be
doing some work on it. Search "man2text1.sh" in the archives.

I tried it on a random manpage and it didn't work quite right,
although the output was mostly plain text. Perhaps this was a nroff or
groff script? I will experiment with what you have posted.

Thanks for sharing these sed scripts.

David




Archive powered by MHonArc 2.6.24.

Top of Page