aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sh/profile.d/env.sh10
-rw-r--r--sh/shrc.d/ksh.sh8
2 files changed, 8 insertions, 10 deletions
diff --git a/sh/profile.d/env.sh b/sh/profile.d/env.sh
deleted file mode 100644
index f1b83919..00000000
--- a/sh/profile.d/env.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-# If we're running some kind of ksh, export ENV to find a suitable startup
-# file. Bash differs considerably from this behaviour; it uses ENV as its
-# startup file when it's invoked as sh(1), and uses .bashrc or --rcfile as its
-# interactive startup file, so it doesn't need to be specified here.
-case $KSH_VERSION in
- *'PD KSH '*) ENV=$HOME/.pdkshrc ;;
-esac
-if [ -n "$ENV" ] ; then
- export ENV
-fi
diff --git a/sh/shrc.d/ksh.sh b/sh/shrc.d/ksh.sh
new file mode 100644
index 00000000..e95e6d3f
--- /dev/null
+++ b/sh/shrc.d/ksh.sh
@@ -0,0 +1,8 @@
+# If we're running some kind of ksh, we'll need to source its specific
+# configuration if it was defined or if we can find it
+case $KSH_VERSION in
+ *'PD KSH '*)
+ [ -f "${KSH_ENV:-"$HOME"/.pdkshrc}" ] || return
+ . "${KSH_ENV:-"$HOME"/.pdkshrc}"
+ ;;
+esac