# makewhatis -- update the whatis database in the man directories.
# Copyright (c) 1990, 1991, John W. Eaton.
# You may distribute under the terms of the GNU General Public
# License as specified in the README file that comes with the man
# Department of Chemical Engineering
# The University of Texas at Austin
PATH
=/bin
:/usr
/local
/bin
:/usr
/ucb
:/usr
/bin
echo "usage: makewhatis directory [...]"
for f
in `find . -name '*' -print`
/^\.SH[ ]*NAME/,/^\.SH/p' $f |\
else if ($1 == ".SH" && insh == 1) {
if (i > 0 && name != NULL) {
namesect = sprintf("%s (%s)", name, sect)
printf("%-20.20s", namesect)
for (j = 0; j < i-1; j++)
printf("%s\n", desc[i-1])
} else if ($1 == ".SH" && insh == 0) {
if (count == 1 && NF > 2) {
for (j = start; j <= NF; j++)
for (j = 1; j <= NF; j++)
done |
sort |
colrm 80 > $dir/whatis.db.tmp
mv $dir/whatis.db.tmp
$dir/whatis