From a13a96596194c7a4ae07f7409a47e17dbfdb98dc Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Mon, 25 Feb 2019 23:30:50 +0100 Subject: [PATCH] Fix PATH and MANPATH manipulation in .bashrc --- dotfiles/.bashrc | 49 ++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc index 1f0bbf3..fa81624 100644 --- a/dotfiles/.bashrc +++ b/dotfiles/.bashrc @@ -44,40 +44,41 @@ bashrc_customize_paths() { # Prevent path_helper from messing with the PATH when starting tmux. # See: https://superuser.com/a/583502 if [ "$(uname)" == "Darwin" ]; then - export PATH="" + PATH="" source /etc/profile fi # Add custom bin dirs to PATH if they exist and are not already in PATH. - while read p - do - if [ -d "$p" ] && [[ ":$MANPATH:" != *":$p:"* ]]; then - MANPATH="$p:$MANPATH" + while read p; do + if [ -d "$p" ] && [[ ":$PATH:" != *":$p:"* ]]; then + PATH="$p:$PATH" fi - done <<-EOF - $prefix/share/man - $prefix/opt/coreutils/libexec/gnuman -EOF - - # If MANPATH is not yet defined, initialize it with the contents of - # `manpath`. - if [ -z ${MANPATH+x} ]; then - export MANPATH=$(manpath) - fi + done <