diff options
author | jkh <jkh@FreeBSD.org> | 1993-07-23 02:36:24 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1993-07-23 02:36:24 +0000 |
commit | 7010a373c2c720263ed4ae6b23c678c074014b40 (patch) | |
tree | 2eac3bb7b843622a39d9335b4155bf12787ea410 /gnu | |
parent | 5a45c927eac8fcc99de677ef834c6e1d20879a63 (diff) | |
download | FreeBSD-src-7010a373c2c720263ed4ae6b23c678c074014b40.zip FreeBSD-src-7010a373c2c720263ed4ae6b23c678c074014b40.tar.gz |
Added Christoph Robitschko's catman
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/man/Makefile | 2 | ||||
-rw-r--r-- | gnu/usr.bin/man/catman/Makefile | 7 | ||||
-rw-r--r-- | gnu/usr.bin/man/catman/catman | 36 |
3 files changed, 44 insertions, 1 deletions
diff --git a/gnu/usr.bin/man/Makefile b/gnu/usr.bin/man/Makefile index 1777b66..0e7e506 100644 --- a/gnu/usr.bin/man/Makefile +++ b/gnu/usr.bin/man/Makefile @@ -5,6 +5,6 @@ # distribution. # -SUBDIR = lib man manpath apropos whatis makewhatis +SUBDIR = lib man manpath apropos whatis makewhatis catman .include <bsd.subdir.mk> diff --git a/gnu/usr.bin/man/catman/Makefile b/gnu/usr.bin/man/catman/Makefile new file mode 100644 index 0000000..8cb35e5 --- /dev/null +++ b/gnu/usr.bin/man/catman/Makefile @@ -0,0 +1,7 @@ +obj cleandir clean depend rcsfreeze tags all: + @echo -n + +install: + install -c -o bin -g bin -m 555 catman /usr/bin + +.include "../Makefile.inc" diff --git a/gnu/usr.bin/man/catman/catman b/gnu/usr.bin/man/catman/catman new file mode 100644 index 0000000..a2d16a1 --- /dev/null +++ b/gnu/usr.bin/man/catman/catman @@ -0,0 +1,36 @@ +#!/bin/sh +# usage: sh catman +# put the section numbers here: +SECTIONS="1 2 3 4 5 6 7 8" +MANDIR=/usr/share/man + +formatman() +{ + echo " "$1 "->" $* + (cd cat$section; rm -f $*) + nroff -man < man$section/$1 > cat$section/$1 + catfile=$1; shift + while [ $# -gt 0 ] + do + ln cat$section/$catfile cat$section/$1 + shift + done +} + +cd $MANDIR +for section in $SECTIONS +do + echo formatting section $section ... + + IFS=" " + allfiles=`ls -i1 man$section | sort | awk '{if (inode ~ $1) printf "/" $2; + else printf " " $2; inode = $1 } END {printf "\n"}'` + for files in $allfiles + do + IFS="/" + tfiles=`echo $files` + IFS=" " + formatman $tfiles + done +done +exit 0 |