Skip to content

Instantly share code, notes, and snippets.

@nosrednakram
Created January 4, 2012 21:05
Show Gist options
  • Save nosrednakram/1562135 to your computer and use it in GitHub Desktop.
Save nosrednakram/1562135 to your computer and use it in GitHub Desktop.
Simple Path Munge for shell
# BASH PATH Munge
pathmunge () {
if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment