Skip to content

Instantly share code, notes, and snippets.

@jmahowald
Created February 1, 2011 17:51
Show Gist options
  • Save jmahowald/806259 to your computer and use it in GitHub Desktop.
Save jmahowald/806259 to your computer and use it in GitHub Desktop.
Scriptlet for finding out which jar contains a given file - From Vadim Snitkosvky
#!/bin/sh
temp_1=$1
temp_2=$2
LOOK_FOR=${temp_1}
LOCATION_TO_SEARCH=${temp_2:-.}
echo "We are looking for \"$LOOK_FOR\" ... in $LOCATION_TO_SEARCH"
for i in `find $LOCATION_TO_SEARCH -name "*jar"`
do
echo "Looking in $i ..."
jar tvf $i | grep $LOOK_FOR > /dev/null
if [ $? == 0 ]
then
echo "==> Found \"$LOOK_FOR\" in $i"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment