diff options
Diffstat (limited to 'libre/filesystem/profile')
-rw-r--r-- | libre/filesystem/profile | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libre/filesystem/profile b/libre/filesystem/profile index ca39d11f2..78ed69f95 100644 --- a/libre/filesystem/profile +++ b/libre/filesystem/profile @@ -1,10 +1,8 @@ # /etc/profile -# Set our umask -umask 022 - -# Append our default paths -appendpath () { +# Append "$1" to $PATH when not already in. +# This function API is accessible to scripts in /etc/profile.d +append_path () { case ":$PATH:" in *:"$1":*) ;; @@ -13,11 +11,12 @@ appendpath () { esac } -appendpath '/usr/local/sbin' -appendpath '/usr/local/bin' -appendpath '/usr/bin' -unset -f appendpath +# Append our default paths +append_path '/usr/local/sbin' +append_path '/usr/local/bin' +append_path '/usr/bin' +# Force PATH to be environment export PATH # Load profiles from /etc/profile.d @@ -28,6 +27,9 @@ if test -d /etc/profile.d/; then unset profile fi +# Unload our profile API functions +unset -f append_path + # Source global bash config, when interactive but not posix or sh mode if test "$BASH" &&\ test "$PS1" &&\ |