From: short <> Date: Sat, 6 Aug 2005 23:29:14 +0000 (+0000) Subject: +Fix $USER and $LOGNAME (not $MAIL) for /etc/passwd "root-..." lines. X-Git-Url: http://git.jankratochvil.net/?p=nethome.git;a=commitdiff_plain;h=8d2067d015a13cd5d5526f7a5e1dbc1ee08c3d7b +Fix $USER and $LOGNAME (not $MAIL) for /etc/passwd "root-..." lines. --- 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 # ,