system: Adjust '.bashrc' skeleton for non-interactive SSH sessions.

* gnu/system/shadow.scm (default-skeletons)[bashrc]: Source /etc/profile
  when in a non-interactive SSH session.
This commit is contained in:
Ludovic Courtès 2015-03-12 19:00:54 +01:00
parent 99e64a6e77
commit 9a10acc986
1 changed files with 12 additions and 0 deletions

View File

@ -120,6 +120,18 @@
# Honor per-interactive-shell startup file
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi\n"))
(bashrc (text-file "bashrc" "\
# Bash initialization for interactive non-login shells and
# for remote shells (info \"(bash) Bash Startup Files\").
if [ -n \"$SSH_CLIENT\" -a -z \"`type -P cat`\" ]
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
fi
PS1='\\u@\\h \\w\\$ '
alias ls='ls -p --color'
alias ll='ls -l'\n"))