diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-17 18:42:56 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-17 18:45:49 +1200 |
commit | 4d612862149ca2337f0e78a14eb6a2f43de0ab5c (patch) | |
tree | 8bf5fe396b93a7e0e1a5c3245f40708e434a9974 /sh | |
parent | Move completion section below function section (diff) | |
download | dotfiles-4d612862149ca2337f0e78a14eb6a2f43de0ab5c.tar.gz dotfiles-4d612862149ca2337f0e78a14eb6a2f43de0ab5c.zip |
Move interactive tests back into *rc files
I don't fully understand why I have to do it this way yet, but if I
don't, calling SSH with a command raises "stdin: not a terminal" because
~/.bashrc was called.
Diffstat (limited to 'sh')
-rw-r--r-- | sh/profile | 8 | ||||
-rw-r--r-- | sh/shrc | 6 |
2 files changed, 10 insertions, 4 deletions
@@ -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 @@ -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 |