diff --git a/config/home/.bash_profile b/config/home/.bash_profile new file mode 100644 index 0000000..7e0655d --- /dev/null +++ b/config/home/.bash_profile @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# ~/.bash_profile - bash login script. +# +# (C) Bruno Raoult ("br"), 2024 +# Licensed under the GNU General Public License v3.0 or later. +# Some rights reserved. See COPYING. +# +# You should have received a copy of the GNU General Public License along with this +# program. If not, see . +# +# For login shells, ~/.profile is executed. Debian default one does: +# 1) source .bashrc if it exists +# 2) add "$HOME"/bin in PATH +# This imply a duplicate "$HOME/bin" in PATH, as we do everything in .bashrc.$user. + + [ -f "$HOME/.bashrc" ] && . "$HOME/.bashrc" diff --git a/config/home/.bashrc.br b/config/home/.bashrc.br index f15d567..cc47342 100644 --- a/config/home/.bashrc.br +++ b/config/home/.bashrc.br @@ -2,7 +2,7 @@ # # ~/.bashrc.br - user specific initialization # -# (C) Bruno Raoult ("br"), 2001-2023 +# (C) Bruno Raoult ("br"), 2001-2024 # Licensed under the GNU General Public License v3.0 or later. # Some rights reserved. See COPYING. # @@ -14,6 +14,12 @@ # Usage: to be invoked from .bashrc. # i.e., add at the end of .bashrc: # [ -f "$HOME/.bashrc.$USER" ] && . "$HOME/.bashrc.$USER" +# +# Debian default ~/.profile does: +# 1) source .bashrc if it exists +# 2) add "$HOME"/bin in PATH +# This imply a duplicate "$HOME/bin" in PATH, as we do everything here. +# Better to have a ~/.bash_profile with the lines above. # _var_del() - remove an element from a colon-separated list. # $1: name (reference) of a colon separated list diff --git a/config/home/.bashrc.br.lorien b/config/home/.bashrc.br.lorien index baf6d11..86b5747 100644 --- a/config/home/.bashrc.br.lorien +++ b/config/home/.bashrc.br.lorien @@ -2,7 +2,7 @@ # # ~/.bashrc.br.lorien - host specific initialization # -# (C) Bruno Raoult ("br"), 2001-2023 +# (C) Bruno Raoult ("br"), 2001-2024 # Licensed under the GNU General Public License v3.0 or later. # Some rights reserved. See COPYING. # @@ -44,17 +44,21 @@ fi # The alias, when invoked, will: # (1) change working directory to $1 # (2) source $3 when $3 is not '-'. $3 path can be relative (preferred), or -# absolute. If $3 is "+", it will default to "./scripts/env.sh". +# absolute. If $3 is "+", it will default to "scripts/env.sh". # # Examples: # _vardir MYDIR mydir - ~/foo/mydirprj _vardir() { local _v="$1" _a="$2" _s="$3" _p="$4" + if [[ ! -d $_p ]]; then + printf "ignored project: %s\n" "$_p" + return 0 + fi local _x="cd $_p" export "$_v"="$_p" case "$_s" in -) ;; - +) _s="./scripts/env.sh" ;& + +) _s="scripts/env.sh" ;& *) if [[ -r "$_p/$_s" ]]; then _x+="; . $_s" else