Saving UNIX manual man pages into plain text files with proper formatting
Posted on 2005-03-21
I would like to save the formatted plain text output of UNIX (HP-UX) manual pages into plain text files for later searching.
I have found a partial solution in the question listed below which is something like:
man cut | nroff -Tlp | sed 's/.^H//g' | tee cut.ascii.man | more
(The more is there for troubleshooting)
The problem is that this wraps on column 66!!
Solution Title: how to output the man pages to a file?
asked by academic on 08/31/2000 12:29PM PDT
(By the way how do I get the actual question id for the above so that I don't have to reffer to it by title and date?)
The original solution called for groff and -Tascii.
However, problem is that:
a) I am working in a corporate HP-UX 11.11 environment with little control of SA stuff.\
b) I do not have groff (GNU roff -right?) so I used nroff and substituted -Tlp.
c) All is well except that the output is wrapped for me on COLUMN 66 !
It looks like nroff is using /usr/lib/term/termlp. Perhaps it thinks the output device is only 65 chars?
I don't know its format and can't control it if I did.
My main motivation is to be able ot search frequently used man pages with vi.
I don't have less. I could probably have it but would still rather have a file with vi.
My main reason for this is that I am using putty to connect to HP-UX as an xterm and have set colors for approximately black on white.
man insists on lighting up inverse video which makes it look unreadable as it happens in so many places.
A workaround would be to ask the xterm, man or putty not to do the inverse video.
However, I fear this also involves termcap, another system resource over which I have no control.
I would like to award 250 points if the moderator allows the post. If it is not allowed please answer my questions in some detail.