Created
May 19, 2011 13:00
-
-
Save shyiko/980697 to your computer and use it in GitHub Desktop.
Looks for class inside JARs/WARs/EARs/SARs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIRECTORY=$1 | |
CLASS_NAME=$2 | |
find $DIRECTORY -name '*.[jwes]ar' | while read LINE; do | |
grep -q $CLASS_NAME "$LINE"; | |
if [ $? -eq 0 ]; then | |
REFERENCES=$(jar tvf "$LINE" | grep $CLASS_NAME); | |
if [ -n "$REFERENCES" ]; then | |
echo "$LINE"; | |
echo "$REFERENCES"; | |
echo; | |
fi; | |
fi; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment