org. of local man(1) pages

Robert Felps felps at convex.UUCP
Wed Oct 10 13:02:29 AEST 1990


rgc at wam.umd.edu (Ross Garrett Cutler) writes:

>	I'm setting up local man pages on an Ultrix system.  Ideally,
>I would want to put them in /usr/local/man, but DEC's man(1) doesn't
>handle multiple paths.  And if I put them in /usr/man (e.g.  localprog.1l)
>you have to type "man 1l localprog" to get any info!  I've tried to compile
>Berkleys man.c (which does support mult. paths via MANPATH or -M), but I
>could not get it to work.  Please help...Ross.

Here is something I setup on a heterogeneous network to handle man pages
from various vendors/systems. It doesn't have to do all these checks,
just check for local man pages and run nroff -man file else run man.
Sorry the codes not shar'ed.

------------------------------ code starts --------------------------------
PATH=/bin:/usr/bin:$PATH
HOSTNAME=`hostname`
while [ -n "$*" ]
 do
  case "$1" in
              -*) OPTS="$OPTS $1" ;;
    [12345678ln]) SECTION=$1 ;;
               *) FILES="$FILES $1" ;;
  esac
  shift
 done
if [ -n "$SECTION" ]
then :
else SECTION="*"
fi
for F in $FILES
 do
	# local man pages stored in NFS fs /share under subdir man
  if [ -f /share/man/man${SECTION}/${F}.${SECTION} ]
  then tbl /share/man/man${SECTION}/${F}.${SECTION} |
       nroff -T$TERM -man $OPTS                     |
       more
  else
        if [ "$SECTION" = "*" ]
        then SECTION=""
        fi
	 # System V man pages are the default for the hp system
        if [ "$HOSTNAME" = "hp835" ]
        then man $OPTS $SECTION $F
        else # Notify user that BSD/Sun man pages are being used(net default)
	     echo "NOTE: using man pages from \"suni\""
             rsh suni man "$OPTS $SECTION $F" | more
        fi
  fi
 done



More information about the Comp.unix mailing list