From 1615d7044ddd5c65ca212f1a073f91efc418bc89 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sat, 29 Nov 2014 23:36:29 +0100 Subject: [PATCH] Make check for "interactive shells" more robust --- sys/bashrc | 5 ++++- sys/profile | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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` -- 2.39.2