From 9a3348f6a7cfc4e2d4097cdbf417b7fac84535ba Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Sat, 7 May 2022 12:21:08 +0300 Subject: [PATCH] separate user paths --- bash_rc | 9 ++++++++- bashrc.d/user_bin | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 bashrc.d/user_bin diff --git a/bash_rc b/bash_rc index ad9cba4..823813a 100755 --- a/bash_rc +++ b/bash_rc @@ -16,7 +16,14 @@ fi # Uncomment the following line if you don't like systemctl's auto-paging feature: # export SYSTEMD_PAGER= -export PATH="${PATH}:${HOME}/bin:/usr/local/bin:/usr/local/sbin" +# Local bin folders in path +if [ -d /usr/local/bin ]; then + export PATH="${PATH}:/usr/local/bin" +fi + +if [ -d /usr/local/sbin ]; then + export PATH="${PATH}:/usr/local/sbin" +fi # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. diff --git a/bashrc.d/user_bin b/bashrc.d/user_bin new file mode 100644 index 0000000..f65c5a3 --- /dev/null +++ b/bashrc.d/user_bin @@ -0,0 +1,10 @@ +#!/bin/bash +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/bin" ] ; then + PATH="$HOME/bin:$PATH" +fi + +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/.local/bin" ] ; then + PATH="$HOME/.local/bin:$PATH" +fi