Skip to content

Commit

Permalink
Make shell interactivity switch more portable
Browse files Browse the repository at this point in the history
`.profile` is used by all bourne-again compatible shells. The double square
brackets test is not supported by all of them. Same with the globbing string
comparison, which is not supported by mksh either. This commit also removes the
workaround for mksh.
  • Loading branch information
Lain authored and neeasade committed Oct 20, 2017
1 parent 6245e55 commit 76d6eb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 0 additions & 2 deletions shell/.mkshrc
@@ -1,3 +1 @@
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
. $HOME/.profile
5 changes: 4 additions & 1 deletion shell/.profile
@@ -1,5 +1,8 @@
# if not running interactively, bail
test "$- != *i*" || exit
case "$-" in
*i*) ;;
*) return;;
esac

# source everything
for file in $HOME/.sh.d/*; do
Expand Down

0 comments on commit 76d6eb3

Please sign in to comment.