From f36a80b49c657f1e6fa17df34b9993633c66acf5 Mon Sep 17 00:00:00 2001 From: Konstantin Gredeskoul Date: Fri, 9 Jul 2021 13:19:28 -0700 Subject: [PATCH] Do not overwrite the PATH --- init.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init.sh b/init.sh index a15c32c..8191058 100644 --- a/init.sh +++ b/init.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash # vim: ft=bash -PATH="/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin:/opt/local/bin:${PATH}" -export PATH + +for path in /usr/local/bin /usr/bin /bin /sbin /usr/sbin /opt/local/bin; do + [[ -d "${path}" ]] && echo "${PATH}" | grep -q "${path}" || export PATH="${PATH}" +done set +e export SHELL_COMMAND