Added Christoph Robitschko's catman
This commit is contained in:
parent
5bd44448a9
commit
9bd9789ec0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184
@ -5,6 +5,6 @@
|
|||||||
# distribution.
|
# distribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
SUBDIR = lib man manpath apropos whatis makewhatis
|
SUBDIR = lib man manpath apropos whatis makewhatis catman
|
||||||
|
|
||||||
.include <bsd.subdir.mk>
|
.include <bsd.subdir.mk>
|
||||||
|
7
gnu/usr.bin/man/catman/Makefile
Normal file
7
gnu/usr.bin/man/catman/Makefile
Normal 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"
|
36
gnu/usr.bin/man/catman/catman
Normal file
36
gnu/usr.bin/man/catman/catman
Normal 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
|
Loading…
Reference in New Issue
Block a user