freebsd-nq/share/man/tools/mgrep

24 lines
452 B
Plaintext
Raw Normal View History

#!/bin/sh
#
# $FreeBSD$
MANDIR=/usr/share/man
TMPDIR=/usr/share/man/tmp
1994-05-30 19:09:18 +00:00
date > $TMPDIR/greps
echo "Grep list: $*" >> $TMPDIR/greps
echo >> $TMPDIR/greps
for pattern in $*
do
echo "\n================" >> $TMPDIR/greps
echo "$pattern:" >> $TMPDIR/greps
for dir in 1 2 3 4 5 6 7 8
do
cd $MANDIR/man$dir
echo "cat <<'EOF' >---------------" >> $TMPDIR/greps
echo "Section $dir" >> $TMPDIR/greps
grep $pattern *.* >> $TMPDIR/greps
done
done