The problem is typing the long-line command is also complicated:-) unless you put it in a script.

Here is my script(remember to change mode to 755 in order to execute it):
++++++++++++++++++++++++++++++++++++++++++++
#!/bin/bash
#filename: jarsearch.sh

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
++++++++++++++++++++++++++++++++++++++++++++

You can export the output into a file using "./jarsearch.sh 'path/' 'searching_file' > /tmp/output.txt" or like.

Daniel Zhang

Pratik Patel wrote:

#!/bin/sh

check_jar() {
     echo $1
     jar tvf $1 | grep <filename>
}

foreach i in `ls *.jar`
check_jar $i




that's just too complicated :) Use this simple command either in Unix or Cygwin:

find /path/to/jars -name "*.jar" -exec unzip -l {} \; > /tmp/jarfilelist

then view or search the file. The nice thing about this is that you can just run the above command whenever you add/update a jar in your repository then just open the file in your IDE/vi/emacs to quickly find something.


-Pratik


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




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

Reply via email to