Added Christoph Robitschko's catman

This commit is contained in:
Jordan K. Hubbard 1993-07-23 02:36:24 +00:00
parent 5bd44448a9
commit 9bd9789ec0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184
3 changed files with 44 additions and 1 deletions

View File

@ -5,6 +5,6 @@
# distribution.
#
SUBDIR = lib man manpath apropos whatis makewhatis
SUBDIR = lib man manpath apropos whatis makewhatis catman
.include <bsd.subdir.mk>

View File

@ -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"

View File

@ -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