find /dir/full/of/jars -type f | grep jar | grep -v md5 | grep -v sha1 >> jars.txt
sed 's/\ cygdrive\ c/c:/g' jars.txt | while read LINE; do /cygdrive/c/Program\ Files/Java/jdk1.6.0_18/bin/jar.exe -tf $LINE | while read LINEINT; do echo $LINE:$LINEINT >> classes.txt; done ; done
cat classes.txt | grep package/ClassName
Edit: someone on reddit fixed my code:
http://www.reddit.com/r/smallprog/comments/bk6e4/cygwinbashsearch_the_jar_that_contain_that_class/c0n6hhb
find /dir/full/of/jars -type f -print0 -iname '*.jar' | sed 's/\/cygdrive\/c/c:/g' | xargs -0 /cygdrive/c/Program\ Files/Java/jdk1.6.0_18/bin/jar.exe -tf | grep package/Classname
Nessun commento:
Posta un commento
Hello, new comment!