[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#29035] [PATCH 1/2] skel: Test for interactive shell instead of $SSH
From: |
Marius Bakke |
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 |
* 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
- [bug#29035] .bashrc updates, Marius Bakke, 2017/10/27
- [bug#29035] [PATCH 1/2] skel: Test for interactive shell instead of $SSH_CLIENT in .bashrc.,
Marius Bakke <=