system: Test for interactive shell instead of cat in skeleton '.bashrc'.

* gnu/system/shadow.scm (default-skeletons)[bashrc]: Wrap $SSH_CLIENT test in
a conditional testing for interactive shell.
This commit is contained in:
Marius Bakke 2017-10-29 21:02:19 +01:00
parent 83a7a88f93
commit 0ab59dd8b8
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -157,13 +157,12 @@ (define copy-guile-wm
# 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.
source /etc/profile
# We are being invoked from a non-interactive shell. If this
# is an SSH session (as in \"ssh host command\"), source
# /etc/profile so we get PATH and other essential variables.
[[ -n \"$SSH_CLIENT\" ]] && source /etc/profile
fi
# Adjust the prompt depending on whether we're in 'guix environment'.