#!/bin/ksh
#set -x
if [ $# -lt 2 ]; then
echo "usage: ff [flags] dir pattern"
echo ""
echo "ff runs a find on
and then runs"
echo "egrep on the files"
exit 1
fi
flags="$1"
if [ "${flags#-}" != "$flags" ]; then
dir="$2"
pattern="$3"
else
flags=""
dir="$1"
pattern="$2"
fi
find $dir -type f -print | egrep '[A-Za-z]*\.(pc|hpp|cpp|C|inc|htm|html|c|h|y|l|sql)$|Makefile|log' |\
egrep -v '\.o$' |\
xargs egrep $flags "$pattern"