quinta-feira, 5 de março de 2009

Looking for a package into JAR files

A nice script for using in Linux, when looking for some package into JAR files.

#!/bin/sh

# setting where java exists
JAVA_HOME=/opt/java

# what are you looking for?
put here the package
LOOK_FOR="org/springframework/context/annotation"


# looping looking for
for i in `find . -name "*jar"`

do

echo "Looking in $i ..."

$JAVA_HOME/bin/jar tvf $i | grep $LOOK_FOR > /dev/null

if [ $? = 0 ]
then
echo "==> Found \"$LOOK_FOR\" in $i"

fi

done


Nenhum comentário: