diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-18 23:56:22 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-18 23:56:22 +1300 |
commit | 35433c0f2087eacaa0b40841121fe8594e4e22be (patch) | |
tree | ce0e0b8f19d2af672c8d2ada38c18bf930216c3d | |
parent | Move TMUX_SHLVL trick into shrc.d (diff) | |
download | dotfiles-35433c0f2087eacaa0b40841121fe8594e4e22be.tar.gz dotfiles-35433c0f2087eacaa0b40841121fe8594e4e22be.zip |
Defer kshrc loading until after shrc all loaded
-rw-r--r-- | ksh/shrc.d/ksh.sh | 7 | ||||
-rw-r--r-- | sh/shrc | 3 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ksh/shrc.d/ksh.sh b/ksh/shrc.d/ksh.sh index 0045a470..106c898f 100644 --- a/ksh/shrc.d/ksh.sh +++ b/ksh/shrc.d/ksh.sh @@ -30,8 +30,5 @@ fi # If KSH_ENV isn't already set, set it [ -n "$KSH_ENV" ] || KSH_ENV=$HOME/.kshrc -# Check the file named in KSH_ENV exists -[ -f "$KSH_ENV" ] || return - -# Source it (finally) -. "$KSH_ENV" +# If ENV_EXT isn't already set, set it +[ -n "$ENV_EXT" ] || ENV_EXT=$KSH_ENV @@ -19,3 +19,6 @@ for sh in "$HOME"/.shrc.d/*.sh ; do [ -e "$sh" ] && . "$sh" done unset -v sh + +# If ENV_EXT was set and exists, source that too +[ -f "$ENV_EXT" ] && . "$ENV_EXT" |