Prevent section title duplication in man > file redirection?

michaelsanford

Translator, Web Developer
Is there any way to prevent character duplication of these headings when output is redirected to a file (e.g.. % man sh > sh.txt)

ex:
Code:
NNAAMMEE
       sh - command interpreter (shell)...

IInnvvooccaattiioonn
       If no args are present and if...
 
I believe you can use groff to accomplish your aim, but I'm pretty sketchy on the details.
 
Try this: /usr/bin/groff -mandoc -Tascii path_to_manpage | col -b > manpage.txt

If the manpage is in a .gz format, do this one: /usr/bin/gunzip -c path_to_manpage.gz | /usr/bing/groff -mandoc -Tascii | col -b > manpage.txt
 
Back
Top