Reading non-installed man pages, etc.

andi payn andi_payn at
Mon Nov 10 19:19:46 PST 2003

I'd occassionally like to be able to read manpages from somewhere other
than the MANPATH.

Let me give you two concrete examples of things that I can do on linux,
that I don't know how to do on FreeBSD

$ man /mnt/falco3/usr/share/man/man1/ls.1.bz2
$ man /home/andi/foo/doc/foo.1

In the first case, I'm looking at the manpages exported (over NFS) from
a Mandrake linux box; in the second, I'm looking at the manpages for a
program I'm trying to get installed.

First, FreeBSD's man doesn't seem to accept a full pathname. In the
first case, I can get around this with MANPATH or -M ("man
-M/mnt/falco3/usr/share/man ls"), but in the second, that won't help.

Second, FreeBSD's man doesn't handle bz2 compression.

I suppose I could do something like this:

$ bzcat /mnt/falco3/usr/share/man/man1/ls.1.bz2 | groff -man -Tascii
-mtty-char | less

And I could write scripts to wrap this up (figure out whether to use
bzcat, zcat, or cat; whether we're talking to a tty-char-capable
terminal or something else; which charset to use; what pager to use;
etc.). Basically, it'd do everything man is doing except for finding the
page in the MANPATH and dealing with catfiles, which sounds like a bit
of a duplication of effort. 

So, if this is already done somewhere, or there's an way that I've
missed to make man or some other tool do what I want, I'd rather not
reinvent the wheel.

Also, I seem to remember installing GNU's *roff stuff onto a Solaris box
and having a program that let me do 90% of what I want to do. The
groff(1) manpage has a reference to groffer that sounds like it might be
what I'm remembering, but I can't find any more information about it (or
the program itself).

Another alternative would be porting the GNU man (with the bzip2
patches), but I'm not sure this is a good idea (I don't know if it would
require other stuff to be ported, for example; also, the name "gman" is
already taken for a Gtk+ xman-type program).

Any ideas?


More information about the freebsd-questions mailing list