Created
October 6, 2015 20:12
-
-
Save stopyoukid/4dce474ea6d01968d9e9 to your computer and use it in GitHub Desktop.
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
pathadd() { | |
echo "$1" | |
if [ -d "$1" ]; then | |
if [ ":$PATH:" != *":$1:"* ]; then | |
echo "export PATH=\"\$PATH:$1\"" >> ~/.bashrc | |
source ~/.bashrc | |
else | |
echo "$1 is already in the path" | |
fi | |
else | |
echo "Invalid directory: $1" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment