Grepping for classes in jars

There are more robust apps out there that find a Java class given a bunch of jars, but I mostly use this script. Usage is:


jargrep ClassName /scratch/a/dir/with/jars

Script:

#!/bin/bash
# usage: jargrep searchstring dir

for jar in `find $2 -name '*.jar' -type f`
do
  echo $jar
  jar tvf $jar | grep "$1"
done

I leave the echo of each jar searched in so I know how it's progressing, but it makes it hard to tell if the class was actually found when there are a lot of jars.