aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-18 11:20:17 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-18 11:22:27 +1200
commit14062a6b6748241e84bae7fe2342ba5c81cc4e6b (patch)
tree9171ce3e97ae7d3fdd00378177dc39befb5d767e /sh
parentArrange EDITOR/VISUAL in a more typical way (diff)
downloaddotfiles-14062a6b6748241e84bae7fe2342ba5c81cc4e6b.tar.gz
dotfiles-14062a6b6748241e84bae7fe2342ba5c81cc4e6b.zip
Use consistent syntax for sh source loops
Diffstat (limited to 'sh')
-rw-r--r--sh/profile7
-rw-r--r--sh/shrc7
2 files changed, 6 insertions, 8 deletions
diff --git a/sh/profile b/sh/profile
index aced40c2..5dfe0ef3 100644
--- a/sh/profile
+++ b/sh/profile
@@ -4,11 +4,10 @@ if [ -d "$HOME"/.local/bin ] ; then
fi
# Load all supplementary scripts in ~/.profile.d
-for profile in "$HOME"/.profile.d/*.sh ; do
- [ -e "$profile" ] || continue
- . "$profile"
+for sh in "$HOME"/.profile.d/*.sh ; do
+ [ -e "$sh" ] && . "$sh"
done
-unset -v profile
+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
diff --git a/sh/shrc b/sh/shrc
index 3e657d4c..deb55cc2 100644
--- a/sh/shrc
+++ b/sh/shrc
@@ -6,8 +6,7 @@ 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
- [ -e "$shrc" ] || continue
- . "$shrc"
+for sh in "$HOME"/.shrc.d/*.sh ; do
+ [ -e "$sh" ] && . "$sh"
done
-unset -v shrc
+unset -v sh