shell or c-shell?

Tom Christiansen tchrist at convex.COM
Mon Mar 26 06:46:53 AEST 1990


In article <20009 at cs.yale.edu> chen-dahe at CS.Yale.EDU (Dahe Chen) writes:
>I am having trouble with a shell script I wrote (forgive me if it is trivial,
>what can you blame for a naive user):
>
>#! /bin/sh
>#
>MANPATH=/twolf7/dchen/man
>if [ -f $MANPATH/"$1".1 ]
>then
>    nroff -man $MANPATH/"$1".1 | more
>else
>    /usr/ucb/man $1
>fi

Seeing what you're trying to do here, I would strongly recommend that you get
my perl rewrite of man using ndbm whatis databases, assuming you've both
perl and ndbm support.  I'll send it to you if you mail me a path that I
can hope to reply to, meaning either in Internet style or else a
non-mixed-mode address rooted at some very well-known site like uunet.

Following is a list of features my man affords you:

    *   almost always faster than standard man (try 'man me')

    *   take much less diskspace for catpages

    *   supports per-tree tmac macros

    *   compressed man and cat files

    *   user-definable man path via $MANPATH or -M (mine is set this way
          setenv MANPATH "$HOME/man:/usr/local/man:/usr/local/mh/man:/usr/man"

    *   user-definable section search order via -S or $MANSECT (so 
	you can get wait(2) before wait(1) if you want)

    *   $PAGER support

    *   looks up all the places you might find a man page (-w option)

    *   no limits on what subsections go where (if you want to add 7x, ok)

    *   support for multi-char sections like man1m/*.1m

    *   per man-tree tmac files

    *   ability to run man on a local file

    *   ability to easily troff (or preview) a man page

    *   recognizes Sun-style embedded filter directives for tbl and eqn

    *   does the right thing for man tree that don't have DBM whatis files

Here are some features of this version of makewhatis:

    *   it's faster.

    *   tries hard to make pretty output, stripping troff directives.

    *   doesn't blow up on more files in a man directory
        than the shell will glob.

    *   accepts troff string macros for the dashes in the
        the NAME section.

    *   prints a diagnostic for a malformed NAME section.

    *   detects linked (hard, soft, or via .so) man pages

    *   finds *all* references in the NAME section.

    *   recognizes MH's man macros (and .Sh from lwall).

    *   many other things that makewhatis used to do wrong


--tom
--

    Tom Christiansen                       {uunet,uiucdcs,sun}!convex!tchrist 
    Convex Computer Corporation                            tchrist at convex.COM
		 "EMACS belongs in <sys/errno.h>: Editor too big!"



More information about the Comp.unix.questions mailing list