aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh')
-rw-r--r--sh/profile8
-rw-r--r--sh/shrc6
2 files changed, 10 insertions, 4 deletions
diff --git a/sh/profile b/sh/profile
index e190d6ba..78fbd2cc 100644
--- a/sh/profile
+++ b/sh/profile
@@ -10,7 +10,7 @@ for profile in "$HOME"/.profile.d/*.sh ; do
done
unset -v profile
-# If the shell is interactive, and ~/.shrc exists, source that too
-case $- in
- *i*) [ -f "$HOME"/.shrc ] && . "$HOME"/.shrc ;;
-esac
+# If ~/.shrc exists, source that too; the test for interactivity is in there
+if [ -f "$HOME"/.shrc ] ; then
+ source "$HOME"/.shrc
+fi
diff --git a/sh/shrc b/sh/shrc
index e46ec2d8..3e657d4c 100644
--- a/sh/shrc
+++ b/sh/shrc
@@ -1,3 +1,9 @@
+# Make sure the shell is interactive
+case $- in
+ *i*) ;;
+ *) return ;;
+esac
+
# Load all the POSIX-compatible functions from ~/.shrc.d; more advanced shells
# like bash will have their own functions
for shrc in "$HOME"/.shrc.d/*.sh ; do