summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-11-02 15:15:03 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-11-02 15:15:03 -0500
commit6ceb6ec051a136350fcee0c930a5de55f886238a (patch)
treec0b481b095cd785f5fcaa3a1e7fe84a513b89a3e
parent59e5a3c130aa292c335698423b879ff7be7e608f (diff)
downloadpki-dev-6ceb6ec051a136350fcee0c930a5de55f886238a.tar.gz
pki-dev-6ceb6ec051a136350fcee0c930a5de55f886238a.tar.xz
pki-dev-6ceb6ec051a136350fcee0c930a5de55f886238a.zip
Updated JAR script.
-rwxr-xr-xscripts/jar-find.sh19
1 files changed, 12 insertions, 7 deletions
diff --git a/scripts/jar-find.sh b/scripts/jar-find.sh
index 5db604c..cc42055 100755
--- a/scripts/jar-find.sh
+++ b/scripts/jar-find.sh
@@ -1,19 +1,24 @@
#!/bin/sh
dir=$1
-class=$2
-echo Searching for $class in $dir
+shift
+class=$1
+
+while [ "$2" ]
+do
+ class="$class\|$2"
+ shift
+done
+
+echo Searching for $class in $dir...
for file in `find $dir -name '*.jar'`
do
- echo -n Checking $file...
- result=`jar tvf $file | grep $class`
+ result=`jar tvf $file | awk '{print $8;}' | grep '.class$' | sed 's/\.class$//' | sed 's/\//./g' | grep $class`
if [ "$result" ]
then
- echo found!
+ echo "## $file"
jar tvf $file | grep $class
- else
- echo
fi
done