Here is the script:
++++++++++++++++++++++++++++++++++++++++
#!/bin/bash

if [ $# != 2 ]
then
   echo "Usage: ./jarsearch.sh 'path/' 'searching_file' ";
else
   for i in `ls $1|grep '.jar'`
       do
           echo "Search $2 in $1$i";
           jar -tvf $1$i | grep $2;
       done

fi
++++++++++++++++++++++++++++++++++++++++

Daniel

Daniel Zhang wrote:

Rich:

You can use 'jar -tvf jarfile.jar | grep "search_key_string"' to search a particular file in a jar file. For a directory, you can write your own shell script to list jar files in a loop then do the above search. So you have your own shell script as the jar searching utility.

Daniel Zhang

Richard O. Hammer wrote:

I find myself looking at a directory full of jar files and I want to know which, if any, of these jars contains a particular file, which I know by name. Is there some utility to help me with this?

Thanks
Rich Hammer



_______________________________________________
Juglist mailing list
[EMAIL PROTECTED]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to