From: Alexander Barton Date: Sat, 29 Nov 2014 22:36:29 +0000 (+0100) Subject: Make check for "interactive shells" more robust X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ConfigScripts.git;a=commitdiff_plain;h=1615d7044ddd5c65ca212f1a073f91efc418bc89;hp=a0b31bc0283071b3bce0ff1469822575608742ec Make check for "interactive shells" more robust --- diff --git a/sys/bashrc b/sys/bashrc index 559cc8c..40087fe 100644 --- a/sys/bashrc +++ b/sys/bashrc @@ -13,7 +13,10 @@ BASHRCREAD="true" [ -e ~/.ConfigScripts.debug ] && echo " >> /etc/bash.bashrc ..." # Interactive shell? -[ "$PS1" ] || return +case "$-" in + *i*) ;; + *) return ;; +esac # Initialize keychain(1) ssh-agent and gpg-agent helper type -t keychain >/dev/null \ diff --git a/sys/profile b/sys/profile index 0e69c89..207bf5b 100644 --- a/sys/profile +++ b/sys/profile @@ -153,7 +153,10 @@ fi [ -r "/var/lib/${HOSTNAME}/profile" ] && . /var/lib/${HOSTNAME}/profile # interactive shell? -[ "$PS1" ] || return +case "$-" in + *i*) ;; + *) return ;; +esac # validate terminal definition type -t tset >/dev/null && eval `tset -s -Q`