From 9bd9789ec0de8bff1dc0524ae01d14f888117814 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Fri, 23 Jul 1993 02:36:24 +0000 Subject: [PATCH] Added Christoph Robitschko's catman --- gnu/usr.bin/man/Makefile | 2 +- gnu/usr.bin/man/catman/Makefile | 7 +++++++ gnu/usr.bin/man/catman/catman | 36 +++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 gnu/usr.bin/man/catman/Makefile create mode 100644 gnu/usr.bin/man/catman/catman diff --git a/gnu/usr.bin/man/Makefile b/gnu/usr.bin/man/Makefile index 1777b6669a99..0e7e5061f9fd 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 diff --git a/gnu/usr.bin/man/catman/Makefile b/gnu/usr.bin/man/catman/Makefile new file mode 100644 index 000000000000..8cb35e52c3da --- /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 000000000000..a2d16a11704c --- /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