diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index 236807c70a..58613e620d 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm @@ -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'.