Man-cgi
browse UNIX man pages through WWW
version 1.16
Man-cgi is shell-sed-awk script which converts on the fly
the output of the "man" command to HTML.
Here is the normal output
of the command "man elm"
and the same man page
formatted with Man-cgi.
Here is the source of Man-cgi.
Special versions of man-cgi are also available:
- SGI machines, thanks to Jeff C. Glover <jeffg@loki.engr.sgi.com>
- Sun Solaris, thanks to David J. Adams <D.J.Adams@soton.ac.uk>
Installation
Man-cgi is made to be used as a cgi program from an HTTPD server.
In order to work properly following things should be done by the server
administator:
Copy the script itself in the /cgi-bin/ directory of the server.
Turn on the "execute" bit of the script : chmod +x man-cgi
Edit the Configuration Section of the script. That section contains
five variables that should be adjusted (PATH,MANPATH,MANCGI,DOT,PAGES
).
You would probably want to get local copies of the two images that Man-cgi uses. These images are:
Usage
When called without arguments (http://www-server/cgi-bin/man-cgi) it outputs a
"Front Page" with a section list
and query form. When called with arguments, the first argument is the topic
(e.g. ls) and the second argument (optional) is the section to look in.
Examples:
History
- 1.16
- Handle Local File Include Vulnerability.
- 1.15
- Multiple blank lines are supressed.
- 1.14
- Man-cgi now recognizes cross-references that
contain periods (e.g. foo.foo(3)).
- 1.13
- Really fixed problems occuring in pages which used
multi-overstrike for emboldening (hopefully).
- 1.12
- Fixed problems occuring in pages which used multi-overstrike
for emboldening. Now Man-cgi works any number of overstrike.
- 1.11
- Fixed problem with hyphenated cross-references.
- 1.10
- and earlier, no history at that time...
TODO list
Here are some things that I may add to the script:
- Automatic section adjustment. When Man-cgi creates a
cross-reference in a man page to another man page it uses the section
number provided by the man page. This could be a problem because a
man page can be stored in a different section. For example, in our
system the X11 man pages are stored in the "x" section, but the references
in the man pages point to section "1" (e.g.
xlock(1)
instead of the correct xlock(x)
).
- Rewrite the whole script in PERL.
- Add more sed rules to improve the HTML output.
- Support indexes (man -i ...).
Panagiotis Christias, christia@ntua.gr