Skip to content

Instantly share code, notes, and snippets.

@josmardias
Last active August 29, 2015 14:18
Show Gist options
  • Save josmardias/afe135ed3d233d1313d8 to your computer and use it in GitHub Desktop.
Save josmardias/afe135ed3d233d1313d8 to your computer and use it in GitHub Desktop.
Prevent multiple entries on ~/.bashrc
# fix multiple entries when .bashrc is sourced multiple times
if [ -z "$ORIGINAL_PATH" ]; then
export ORIGINAL_PATH="$PATH"
fi
if [ -z "$ORIGINAL_MANPATH" ]; then
export ORIGINAL_MANPATH="$MANPATH"
fi
if [ -z "$ORIGINAL_INFOPATH" ]; then
export ORIGINAL_INFOPATH="$INFOPATH"
fi
export PATH="$ORIGINAL_PATH"
export MANPATH="$ORIGINAL_MANPATH"
export INFOPATH="$ORIGINAL_INFOPATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment