From: Marius Bakke <mbakke@fastmail.com>
To: 29035@debbugs.gnu.org
Subject: [bug#29035] [PATCH 1/2] skel: Test for interactive shell instead of $SSH_CLIENT in .bashrc.
Date: Sat, 28 Oct 2017 01:53:56 +0200 [thread overview]
Message-ID: <20171027235357.28600-1-mbakke@fastmail.com> (raw)
In-Reply-To: <87mv4cxi9n.fsf@fastmail.com>
* 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
next prev parent reply other threads:[~2017-10-27 23:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-27 23:50 [bug#29035] .bashrc updates Marius Bakke
2017-10-27 23:53 ` Marius Bakke [this message]
2017-10-27 23:53 ` [bug#29035] [PATCH 2/2] skel: Return early from .bashrc when the shell is non-interactive Marius Bakke
2017-10-28 7:59 ` Ludovic Courtès
2017-10-28 7:57 ` [bug#29035] [PATCH 1/2] skel: Test for interactive shell instead of $SSH_CLIENT in .bashrc Ludovic Courtès
2017-10-29 10:17 ` Marius Bakke
2017-10-29 14:24 ` Ludovic Courtès
2017-10-29 20:07 ` Marius Bakke
2017-10-29 21:26 ` Ludovic Courtès
2017-11-01 20:38 ` bug#29035: " Marius Bakke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171027235357.28600-1-mbakke@fastmail.com \
--to=mbakke@fastmail.com \
--cc=29035@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.