1993-12-21 06:28:00 +03:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
1995-05-12 03:03:44 +04:00
|
|
|
# Written by J.T. Conklin <jtc@netbsd.org>.
|
|
|
|
# Public domain.
|
1993-12-21 06:28:00 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
trap "rm -f /tmp/whatis$$; exit 1" 1 2 15
|
|
|
|
|
|
|
|
MANDIR=${1-/usr/share/man}
|
|
|
|
if test ! -d "$MANDIR"; then
|
|
|
|
echo "makewhatis: $MANDIR: not a directory"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
find $MANDIR -type f -name '*.0' -print | while read file
|
|
|
|
do
|
|
|
|
sed -n -f /usr/share/man/makewhatis.sed $file;
|
1994-03-19 11:09:16 +03:00
|
|
|
done > /tmp/whatis$$
|
|
|
|
|
|
|
|
find $MANDIR -type f -name '*.0.Z' -print | while read file
|
|
|
|
do
|
|
|
|
zcat $file | sed -n -f /usr/share/man/makewhatis.sed;
|
|
|
|
done >> /tmp/whatis$$
|
|
|
|
|
|
|
|
find $MANDIR -type f -name '*.0.gz' -print | while read file
|
|
|
|
do
|
|
|
|
gzip -dc $file | sed -n -f /usr/share/man/makewhatis.sed;
|
|
|
|
done >> /tmp/whatis$$
|
|
|
|
|
|
|
|
sort -u -o /tmp/whatis$$ /tmp/whatis$$
|
1993-12-21 06:28:00 +03:00
|
|
|
|
1994-02-07 08:11:24 +03:00
|
|
|
install -o bin -g bin -m 444 /tmp/whatis$$ "$MANDIR/whatis.db"
|
1993-12-21 06:28:00 +03:00
|
|
|
exit 0
|