From 7266c6f828a991e0c223bbc2bcfc88f0337076ef Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Tue, 5 Jun 2018 04:55:45 +0200 Subject: [PATCH] use an include guard with .profile --- .profile | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.profile b/.profile index d89ea5a..5621845 100644 --- a/.profile +++ b/.profile @@ -8,20 +8,14 @@ # for ssh logins, install and configure the libpam-umask package. #umask 022 -# if running bash -if [ -n "$BASH_VERSION" ]; then - # include .bashrc if it exists - if [ -f "$HOME/.bashrc" ]; then - . "$HOME/.bashrc" - fi -fi +if [ -z $PROFILE_ALREADY_SET ]; +then + export PROFILE_ALREADY_SET=1 -# set PATH so it includes user's private bin if it exists -if [ -d "$HOME/bin" ] ; then - PATH="$HOME/bin:$PATH" -fi + # if running bash, include .bashrc if it exists + [ -n "$BASH_VERSION" -a -f "$HOME/.bashrc" ] && . "$HOME/.bashrc"; -# set PATH so it includes user's private bin if it exists -if [ -d "$HOME/.local/bin" ] ; then - PATH="$HOME/.local/bin:$PATH" + # set PATH so it includes user's private bin dirs if they exist + [ -d "$HOME/.local/bin" ] && PATH="$HOME/.local/bin:$PATH" + [ -d "$HOME/bin" ] && PATH="$HOME/bin:$PATH" fi