home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aux
- Path: sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!news.udel.edu!me.udel.edu!johnston
- From: johnston@me.udel.edu (Bill Johnston)
- Subject: Shell script for installing man pages (was: man's problems)
- Message-ID: <Btnu40.JyL@news.udel.edu>
- Sender: usenet@news.udel.edu
- Nntp-Posting-Host: me.udel.edu
- Organization: University of Delaware
- References: <1992Aug23.231247.6667@sunova.ssc.gov>
- Date: Thu, 27 Aug 1992 20:55:11 GMT
- Lines: 71
-
- In article <1992Aug23.231247.6667@sunova.ssc.gov>
- ww2@bullwinkle.ssc.gov (Wes Price) writes:
-
- >More specifically, is there anything that can cope with A/UX's curious
- >/usr/catman hierarchy, and with the fact that there is no nroff source
- >for any of those man pages, and with the fact that there may be alternate
- >man-directory hierarchies which will have nroffable (i.e., not preformatted)
- >man pages?
-
- Here is a shell script by Bob Denny that I found in the archives on
- aux.support.apple.com. It makes installing aux-ready man pages
- from nroff source fairly painless. To use, copy to /usr/local/bin
- and chmod 755 (or similar) to make the file executable.
-
- #!/bin/sh
- # @(#) auxman - format, pack and install manpages on A/UX
- #
- # Bob Denny - Sun Sep 15 15:13:12 1991
- #
- # If man-page ends in ".z" then pack(1) is used to compress the
- # man page text prior to moving it to the final location. If pack
- # fails, the page is installed without the ".z" suffix. Any pre-existing
- # man page is explicitly removed (with or without the ".z") in case it
- # was linked to another page, or had another page linked to it.
- #
- # NOTE: The "lp" terminal type is used, and sed(1) is used to remove
- # the backspace-bolding stuff from nroff's output (it causes premature
- # word-wrapping).
- #
- if [ $# -ne 2 ] ; then
- echo "Incorrect argument count."
- echo "Usage: auxman nroff-src man-page"
- echo " man-page must be full pathname to location at which to"
- echo " install the man page."
- exit 1
- fi
-
- dest=$2
- destnoz=`echo $2 | sed 's/\(.*\)\.z$/\1/`
-
- if [ -f $dest ] ; then
- rm -f $dest
- fi
-
- if [ -f $destnoz ] ; then
- rm -f $destnoz
- fi
-
- nroff -Tlp -man $1 | sed -e 's/\([A-Za-z]\).\1.\1.\1/\1/g' > %TMP%$$
-
- if [ `echo $dest | grep '\.z$'` ] ; then
- pack %TMP%$$ 1>/dev/null 2>&1
- if [ $? -eq 0 ] ; then
- mv %TMP%$$.z $dest || cp %TMP%$$.z $dest
- else
- dest=$destnoz # <==== NOTE!
- cp %TMP%$$ $dest
- fi
- else
- mv %TMP%$$ $dest || cp %TMP%$$ $dest
- fi
-
- rm -f %TMP%*
- chgrp bin $dest
- chown bin $dest
- chmod 0644 $dest
- exit 0
-
- --
- -- Bill Johnston (johnston@me.udel.edu)
- -- 38 Chambers Street; Newark, DE 19711; (302)368-1949
-