Skip to content

Instantly share code, notes, and snippets.

@huseyin
Forked from roktas/pathmunge.sh
Created June 14, 2016 19:19
Show Gist options
  • Save huseyin/8be823acf786d89875105d25982d89f5 to your computer and use it in GitHub Desktop.
Save huseyin/8be823acf786d89875105d25982d89f5 to your computer and use it in GitHub Desktop.
# munge PATH
pathmunge() {
case ":${PATH}:" in *:"$1":*) return 0 ;; esac
[ "$2" = after ] && PATH=$PATH:$1 || PATH=$1:$PATH
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment