#!/bin/sh BIN_DIR=`dirname "$0"` TEMP_DIR=temporary_directory_for_findinjars mkdir -p $TEMP_DIR rm $TEMP_DIR/* 2> /dev/null mode=$1 shift if [ $# -eq 0 ] || { [ "$mode" != "loners" ] && [ "$mode" != "duplicates" ]; }; then echo "Usage: $0 [loners|duplicates] ...."; exit 1 fi for arg in "$@"; do jars="$arg" if [ -d "$arg" ]; then jars=$arg/*.jar fi for jar in $jars; do filename=`echo "$jar"|sed -e "s/\//\-\-/g"` jar tvf $jar|awk '{print $NF}'|grep class > $TEMP_DIR/$filename; done done "$BIN_DIR/analyze.py" $mode $TEMP_DIR rm -r $TEMP_DIR