From c923c385666c33a1f0cf260314056b1620856143 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Thu, 10 Feb 2022 20:15:22 +0100 Subject: [PATCH] [bash] read .local/bash_profile if available --- bash/profile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bash/profile b/bash/profile index 071474b..05704bc 100644 --- a/bash/profile +++ b/bash/profile @@ -1,13 +1,18 @@ # ~/.bash_profile [ -z "$DOTFILES" ] && source "$HOME/.profile" +# Always source local bash_profiles [ -r "$HOME/.bash_profile.local" ] && source "$HOME/.bash_profile.local" +[ -r "$HOME/.local/bash_profile" ] && source "$HOME/.local/bash_profile" if shopt -q login_shell then # This is a bash login shell LOGINHISTORY=~/.login.history - LOGINSTRING="$(date) ${USER}@${HOSTNAME}" - echo $LOGINSTRING > $LOGINHISTORY + if [ -w "${LOGINHISTORY}" ]; then + echo "$(date) ${USER}@${HOSTNAME}" >> $LOGINHISTORY + fi + + unset LOGINHISTORY fi