
# Using pick (which I will provide), write a program
# with two arguments $1 and $2.
# Start by removing $2.
# This program will go through the files in your present directory
# using pick.
# Any file f that you pick is searched with grep for argument $1.
# If grep returns any result then append to file $2 the following
# ===== File f ======
# a bunch of lines containing term $1 in File f

rm $2
for i in `pick t*`
do
if test -f $i
grep $1 $i >$$.tmp;
if test -s $$.tmp
then
echo ==== File $i ======  >> $2
cat $$.tmp >> $2
fi
fi
done
