Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata
#!/bin/sh
#
# findjar.sh by Samuli Kaski
#

VERBOSE=no

if [ $# -ne 2 ]; then
        echo "Usage: findjar.sh <path> <classname>";
        exit;
fi

STARTPATH=$1
CLASS=$2

echo "Starting search for JAR files from directory $STARTPATH"
echo "Looking for the class $CLASS"
echo ""
echo "This might take a while..."
echo ""

for jar in `find $STARTPATH -name '*.jar'`;
do
 BASENAME=`basename $jar`

 if [ "$VERBOSE" == "yes" ]; then
  echo -n "$BASENAME"
 fi

 jar -tf $jar | grep -q $CLASS

 if [ $? -eq 0 ]; then

  if [ "$VERBOSE" == "yes" ]; then
       echo " MATCH, complete path to JAR is $jar"
   read -p "*** Press enter to continue" enter
  else
   echo "$jar"
  fi
 else
  if [ "$VERBOSE" == "yes" ]; then
   echo ""
  fi
 fi
done