aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-03 00:22:17 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-03 00:22:17 +1300
commit3135b4ce8d5974e1dee530928a8aacffe7eac433 (patch)
treef836bd76271f7c313286bc3ebe69376a0cf45f80 /Makefile
parentColor compatibility fixes for tlcs(1df) (diff)
downloaddotfiles-3135b4ce8d5974e1dee530928a8aacffe7eac433.tar.gz
dotfiles-3135b4ce8d5974e1dee530928a8aacffe7eac433.zip
Split ~/.shrc off stub ~/.shinit file
NetBSD sh(1) and possible others don't tolerate a `return` short-circuit for ENV, which means that because that implementation also sources ENV if set regardless of whether the shell is interactive or not, all of the interactive stuff in ~/.shrc and ~/.shrc.d gets uselessly sourced and loaded up for non-interactive invocations of sh(1). To work around this, I've set ENV to be a new ~/.shinit file instead, which sources the ~/.shrc file only if the shell is interactive. ~/.shinit is the filename suggested in the man page for NetBSD sh(1) and Debian dash(1) as well. NetBSD's documented behaviour seems to be contrary to POSIX 2003: > ENV: This variable, when and only when an interactive shell is > invoked, shall be subjected to parameter expansion (see Parameter > Expansion ) by the shell, and the resulting value shall be used as a > pathname of a file containing shell commands to execute in the > current environment. No matter; this works fine, and makes non-interactive invocations of sh(1) on NetBSD much faster.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index cd884662..1131af09 100644
--- a/Makefile
+++ b/Makefile
@@ -307,6 +307,7 @@ install-sh : check-sh
"$(HOME)"/.shrc.d
install -pm 0644 -- sh/profile "$(HOME)"/.profile
install -pm 0644 -- sh/profile.d/* "$(HOME)"/.profile.d
+ install -pm 0644 -- sh/shinit "$(HOME)"/.shinit
install -pm 0644 -- sh/shrc "$(HOME)"/.shrc
install -pm 0644 -- sh/shrc.d/* "$(HOME)"/.shrc.d