From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8ESv-0003BW-31 for guix-patches@gnu.org; Fri, 27 Oct 2017 19:55:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e8ESs-0003ou-1T for guix-patches@gnu.org; Fri, 27 Oct 2017 19:55:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:57419) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e8ESr-0003oc-TG for guix-patches@gnu.org; Fri, 27 Oct 2017 19:55:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e8ESr-0005Et-Lq for guix-patches@gnu.org; Fri, 27 Oct 2017 19:55:01 -0400 Subject: [bug#29035] [PATCH 1/2] skel: Test for interactive shell instead of $SSH_CLIENT in .bashrc. References: <87mv4cxi9n.fsf@fastmail.com> In-Reply-To: <87mv4cxi9n.fsf@fastmail.com> Resent-Message-ID: From: Marius Bakke Date: Sat, 28 Oct 2017 01:53:56 +0200 Message-Id: <20171027235357.28600-1-mbakke@fastmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 29035@debbugs.gnu.org * gnu/system/shadow.scm (default-skeletons): Instead of testing for $SSH_CLIENT, check whether '$-' includes the letter 'i'. --- gnu/system/shadow.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index 236807c70..475960b89 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm @@ -157,12 +157,11 @@ if [ -f ~/.bashrc ]; then . ~/.bashrc; fi\n")) # honor it and otherwise use /bin/sh. export SHELL -if [ -n \"$SSH_CLIENT\" -a -z \"`type -P cat`\" ] +if [[ $- != *i* ]] then # We are being invoked from a non-interactive SSH session - # (as in \"ssh host command\") but 'cat' cannot be found - # in $PATH. Source /etc/profile so we get $PATH and other - # essential variables. + # (as in \"ssh host command\"). Source /etc/profile so we + # get $PATH and other essential variables. source /etc/profile fi -- 2.14.3