From 26abac727b1e06707fa9a4f3b2b6764ceb771d23 Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Mon, 26 Dec 2016 22:39:53 -0800 Subject: [PATCH] Only add directories to PATH that are already in PATH --- bash/environment | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bash/environment b/bash/environment index b6d6b2b..034d29e 100644 --- a/bash/environment +++ b/bash/environment @@ -36,6 +36,9 @@ fi function _add-path { dir="$1" + if [[ $PATH =~ .*$dir.* ]]; then + return + fi if [[ -d $dir ]]; then PATH=$dir:$PATH fi