aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh')
-rw-r--r--sh/profile6
-rw-r--r--sh/shinit4
-rw-r--r--sh/shrc6
3 files changed, 7 insertions, 9 deletions
diff --git a/sh/profile b/sh/profile
index afc308ea..fd87b8fa 100644
--- a/sh/profile
+++ b/sh/profile
@@ -7,8 +7,8 @@ for sh in "$HOME"/.profile.d/*.sh ; do
done
unset -v sh
-# If ENV is unset after running those scripts and ~/.shrc exists, set it as ENV
-if [ -z "$ENV" ] && [ -f "$HOME"/.shrc ] ; then
- ENV=$HOME/.shrc
+# If ENV is still unset, and ~/.shinit exists, use that
+if [ -z "$ENV" ] && [ -f "$HOME"/.shinit ] ; then
+ ENV=$HOME/.shinit
export ENV
fi
diff --git a/sh/shinit b/sh/shinit
new file mode 100644
index 00000000..fe770a70
--- /dev/null
+++ b/sh/shinit
@@ -0,0 +1,4 @@
+# If the shell is interactive, source ~/.shrc
+case $- in *i*)
+ [ -f "$HOME"/.shrc ] && . "$HOME"/.shrc ;;
+esac
diff --git a/sh/shrc b/sh/shrc
index 3e03313c..0e1382aa 100644
--- a/sh/shrc
+++ b/sh/shrc
@@ -1,9 +1,3 @@
-# Make sure the shell is interactive
-case $- in
- *i*) ;;
- *) return ;;
-esac
-
# Don't let anyone write(1) to my terminal
command -p mesg n