Created
October 16, 2014 12:30
-
-
Save JohnArchieMckown/6594447ce93b71802ac9 to your computer and use it in GitHub Desktop.
classmunge is a shell function to add a directory to the CLASSPATH used by Java. It will add the specified directory only if: (1) it currently exists and (2) it is not already on the PATH. It can add the directory either at the beginning of the CLASSPATH (defautl) or at the end of the CLASSPATH.
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
| classmunge () { | |
| if [ -e $1 ]; then | |
| if ! echo $CLASSPATH | /bin/egrep -q "(^|:)$1($|:)" ; then | |
| if [ "$2" = "after" ] ; then | |
| CLASSPATH=$CLASSPATH:$1 | |
| else | |
| CLASSPATH=$1:$CLASSPATH | |
| fi | |
| fi | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment