-
-
Save seasonedgeek/28d0b275ee9fb57aa4cabd748a7559a5 to your computer and use it in GitHub Desktop.
classpath.sh -- build classpaths
This file contains 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
#/bin/bash | |
# strings together all of its arguments into a Java classpath, useful for | |
# grabbing all of the jars in a directory like so: | |
# classpath.sh lib/*.jar | |
# | |
usage(){ | |
echo "Usage: $0 /path/to/*.jar" | |
exit 1 | |
} | |
# invoke usage | |
# call usage() function if /path/to/*.jar files not supplied | |
[[ $# -eq 0 ]] && usage | |
DELIM= | |
CLASSPATH= | |
for PATH_PART in "$@" | |
do | |
CLASSPATH="$CLASSPATH$DELIM$PATH_PART" | |
DELIM=: | |
done | |
echo $CLASSPATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment