Created
March 18, 2020 16:40
-
-
Save andrewmeissner/48a00e544c79ddb2ee5d2734a42c80c1 to your computer and use it in GitHub Desktop.
adds param to path if it isn't already in the path
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
| #!/bin/bash | |
| function setPath { | |
| echo $PATH | grep -q "$1" | |
| if [ $? -ne 0 ]; then | |
| PATH="$PATH:$1" | |
| fi | |
| export PATH | |
| } | |
| setPath "$HOME/mybin" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment