From 8d2067d015a13cd5d5526f7a5e1dbc1ee08c3d7b Mon Sep 17 00:00:00 2001 From: short <> Date: Sat, 6 Aug 2005 23:29:14 +0000 Subject: [PATCH] +Fix $USER and $LOGNAME (not $MAIL) for /etc/passwd "root-..." lines. --- .bashrc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.bashrc b/.bashrc index b4bce39..2141644 100644 --- a/.bashrc +++ b/.bashrc @@ -21,6 +21,13 @@ if [ -z "$_home_short_dotbashrc" ];then # alias norc='TERM="norc-$TERM" ssh -t -o 'NoHostAuthenticationForLocalhost yes' $USER@localhost "cd $PWD; TERM=$TERM;"' function norc { TERM="norc-$TERM" ssh -t -o 'NoHostAuthenticationForLocalhost yes' $USER@localhost "cd $PWD; TERM=$TERM;" "$@"; }; export -f norc +# Fix $USER and $LOGNAME (not $MAIL) for /etc/passwd line: +# root-lace:x:0:0:root for Jan Kratochvil:/home/root-lace:/bin/bash +if [ "$UID" -eq 0 -a "$USER" = "root" -a "$HOME" != "${HOME#*/root-}" ];then + USER="${HOME##*/}" + LOGNAME="$USER" +fi + if [ -f /etc/bashrc ];then source /etc/bashrc;fi function _bash_profile_addpath # , -- 1.8.3.1