git://git.jankratochvil.net
/
nethome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
83846f5
)
+Fix $USER and $LOGNAME (not $MAIL) for /etc/passwd "root-..." lines.
author
short
<>
Sat, 6 Aug 2005 23:29:14 +0000
(23:29 +0000)
committer
short
<>
Sat, 6 Aug 2005 23:29:14 +0000
(23:29 +0000)
.bashrc
patch
|
blob
|
history
diff --git
a/.bashrc
b/.bashrc
index
b4bce39
..
2141644
100644
(file)
--- 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
# 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 # <variablename>,<dirpathname>
if [ -f /etc/bashrc ];then source /etc/bashrc;fi
function _bash_profile_addpath # <variablename>,<dirpathname>