Skip to content

Instantly share code, notes, and snippets.

@bonifaido
Created March 22, 2012 14:09
Show Gist options
  • Save bonifaido/2158550 to your computer and use it in GitHub Desktop.
Save bonifaido/2158550 to your computer and use it in GitHub Desktop.
Finds a class in a library of JARs
#!/usr/bin/bash
if [ $# != 2 ]
then
echo usage: findclass [CLASS] [DIR]
exit 1
fi
jars=(`find $2 -name '*.jar'`)
for jarfile in ${jars[@]}
do
echo Processing $jarfile ...
jar tvf $jarfile | grep "/$1.class\$"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment