Last active
December 15, 2015 03:29
-
-
Save lizell/5194993 to your computer and use it in GitHub Desktop.
Small function that can be put in your .bashrc that checks the given paths for jars that exists in both paths. Helpful for e.g. finding jars that exists in both shared lib and webapp lib.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Checks the given paths for jars that exists in both paths. Helpful | |
## for e.g. finding jars that exists in both shared lib and webapp lib. | |
cpdup() { | |
if [ "$2" = "" ]; then | |
echo "Usage: cpdup .../WEB-INF/lib .../shared/lib" | |
else | |
for JAR in $1/*.jar | |
do | |
JAR_FILE=`basename $JAR` | |
JAR_NAME=${JAR_FILE%-*} | |
if [ -e $2/$JAR_NAME* ]; then | |
echo -en "$JAR_NAME:\t$JAR\t" | |
ls -1 $2/$JAR_NAME* | |
fi | |
done | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment