[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: alternative man page reader?



Bradley Bell wrote:

> Here, for example, is a teeny tiny little nroff that does a good job
> reading most, but not all man pages:
> ftp://metalab.unc.edu/pub/Linux/utils/text/nroffsrc.tar.Z

I'll have to check this out. If anyone is thinking about implementing
a short 'man' shell script to go with it, here's what i'm using. Maybe
you can hack around with it.

----

#!/bin/sh

MANPATHS="/usr/man/ /usr/X11R6/man/"
SECTIONS="[1-8]" # change this to "1" for standard 'man' behavior

if test "$#" == "2"; then SECTIONS=$1; shift; fi

find $MANPATHS -name "$1.${SECTIONS}*.gz" -exec zcat -q '{}' ';' | \
    groff -t -mandoc -Tascii - 2>/dev/null | ${PAGER:-more}

----

It works pretty well, and I haven't noticed much of a speed
difference. Consequently, I've been able to get rid of man-db, libdb2,
and the whole /var/catman hierarchy. If anyone can suggest
improvements or point out something problematic it'd be very welcome.

-- 
Moglen's Metaphorical Corollary to Faraday's Law: if you wrap the
Internet around every person on the planet and spin the planet,
software flows in the network.


Reply to: