#!/bin/sh
program=`basename $0`
aproposgrepopt1='i'
aproposgrepopt2=''
whatisgrepopt1='iw'
whatisgrepopt2=''
grepopt1=$%apropos_or_whatis%grepopt1
grepopt2=$%apropos_or_whatis%grepopt2
if [ $then
echo "usage: $program keyword ..."
exit 1
fi
manpath=`man %manpathoption% | tr : '\040'`
if [ "$manpath" = "" ]
then
echo "$program: manpath is null"
exit 1
fi
args=
for arg in $*; do
case $arg in
--version|-V|-v)
echo "$program from %version%"
exit 0
;;
--help|-h)
echo "usage: $program keyword ..."
exit 0
;;
-*)
echo "$program: $arg: unknown option"
exit 1
;;
*)
args="$args $arg"
esac
done
while [ "$1" != "" ]
do
found=0
for d in /var/cache/man $manpath /usr/lib
do
if [ -f $d/whatis ]
then
if grep -"$grepopt1" "$grepopt2""$1" $d/whatis
then
found=1
fi
fi
done
if [ $found = 0 ]
then
echo "$1: nothing appropriate"
fi
shift
done | eval ${PAGER:-more -E}
exit