#!/bin/sh # Man-cgi : a Common Gateway Interface which converts the output of # the "man" command to HTML # # Version : 1.11 SGI # # Author : Panagiotis J. Christias # SGI additions by Jeff C. Glover # # Usage : it goes in the /cgi-bin/ directory. When called without # arguments (http://www-server/cgi-bin/man-cgi) it output an # "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: # http://www.ntua.gr/cgi-bin/man-cgi?ls # http://www.ntua.gr/cgi-bin/man-cgi?sleep+3 # # Notice : Man-cgi uses the following two images, you may want to get them # and put them in your w3 server: # http://www.ntua.gr/images/doty.gif # http://www.ntua.gr/images/pages.gif # # Last update: Tue Jun 14 1994 # ### CONFIGURATION SECTION : change the following variables to fit your needs ### # The HTTPD server may not pass the enviroment variables to the script. # You should add your system path here : PATH=/etc:/usr/etc:/usr/local/bin:.:/usr/sbin:/usr/bsd:/sbin:/usr/bin:/bin:/usr/bin/X11 export PATH # The same for the man path here : MANPATH=/usr/share/catman:/usr/share/man:/usr/catman:/usr/man export MANPATH # The full URL of the Man-cgi : MANCGI='http://loki.engr.sgi.com/cgi-bin/man-cgi' # The URL of the two images : DOT=http://loki.engr.sgi.com/Art/doty.gif PAGES=http://loki.engr.sgi.com/Art/pages.gif ### END OF CONFIGURATION SECTION ############################################### SECTION=$2 COMMAND=$1 echo "Content-type: text/html" echo "" if [ $# -eq 2 ] ; then if [ $2 = "00" ] ; then read a COMMAND=`echo $a | sed 's/command=\(.*\)&.*/\1/'` SECTION=`echo $a | sed 's/command=.*§ion=\(.*\) /\1/'` if [ $SECTION = "ANY" ] ; then SECTION="" fi; fi; fi if [ $# -ne 0 ] ; then cat <UNIX man pages : $COMMAND ($SECTION)

NOTE: click here if you get an empty page.


END man $SECTION $COMMAND | \ sed \ -e 's//»/g' \ \ -e '/^[A-Z]/s/.//g' \ -e 's/^[A-Z][ ,A-Z]*$/

&<\/H2>/' \ \ -e 's/_...\(.\)/\1<\/i>/g' \ -e 's/_\(.\)/\1<\/i>/g' \ -e 's/...\(.\)/\1<\/b>/g' \ -e 's/.\(.\)/\1<\/b>/g' \ -e 's/<\/i>//g' \ -e 's/<\/b>//g' \ \ -e 's/^ \([A-Z][ ,0-9A-z]*\)$/ \1<\/b>/' \ -e 's/^ \([A-Z][ ,0-9A-z]*\)$/ \1<\/b>/' \ \ -e "1,10s#\([0-9A-z][-,0-9A-z]*(\([1-9]\)[A-z]*)\)#\1#g" \ -e "10,\$s#\(\([0-9A-z][-,0-9A-z]*\)(\([1-9]\)[A-z]*)\)#\1#g" \ -e "10,\$s#\(\([0-9A-z][-,0-9A-z]*\)(\([1-9]\)[A-z]*)\)#\1#g" \ \ -e "s#+<\/b>##" \ \ -e 's/«/\</g' \ -e 's/»/\>/g' \ -e 's:_<i>_:_:g' \ \ -e '1s/^/
/' \
          -e '$s/$/
<\/PRE>
/'
# AWK part eliminated... 

else
  cat <
  UNIX man pages
  
  
  

UNIX ON-LINE Man Pages


These are the UNIX man pages. The html versions are created on the fly by a simple shell/sed/awk script.

NOTICE: There are still problems with the man pages that are not stored in the right section. In this case you'ld get an empty page. Follow the link at the top of the empty page and you'll your man page (hopefully).
Here are the intro pages of each section:

  1. USER COMMANDS
  2. SYSTEM CALLS
  3. C LIBRARY FUNCTIONS
  4. DEVICES AND NETWORK INTERFACES
  5. FILE FORMATS
  6. GAMES AND DEMOS
  7. ENVIRONMENTS, TABLES, AND TROFF MACROS
  8. MAINTENANCE COMMANDS
  9. NEW MAN PAGES
  10. OLD MAN PAGES
  11. LOCAL MAN PAGES
  12. PUBLIC MAN PAGES


You can also request a man page by name and (optionally) by section:

Set command name :

Set Section number :

END fi cat <
© 1994 Man-cgi 1.11, Panagiotis Christias <christia@theseas.ntua.gr>
SGI Modifications by jeffg@sgi.com. END