chiark
/
gitweb
/
~mdw
/
profile
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b1a598d
)
dot/shell-rc: Get user name from id(1) if it's not in the environment.
author
Mark Wooding
<mdw@distorted.org.uk>
Tue, 8 Aug 2017 22:59:02 +0000
(23:59 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Tue, 8 Aug 2017 22:59:02 +0000
(23:59 +0100)
dot/shell-rc
patch
|
blob
|
blame
|
history
diff --git
a/dot/shell-rc
b/dot/shell-rc
index 11b9fc7f8e04296eeae7ba8acf116c0db337eb3f..ac8819dcbe0a1fa3e5ab02bd8563114b15f0e65d 100644
(file)
--- a/
dot/shell-rc
+++ b/
dot/shell-rc
@@
-37,7
+37,7
@@
__mdw_set_prompt_pieces () {
## highlight when I'm running as some other user. Highlight when this
## isn't the outermost shell on the terminal.
local left right user u tty
## highlight when I'm running as some other user. Highlight when this
## isn't the outermost shell on the terminal.
local left right user u tty
- user=${USER-$
LOGNAME
}
+ user=${USER-$
{LOGNAME-$(id -un)}
}
case $(id -u) in
0)
left=$(echo « | iconv -f UTF-8 -t //translit)
case $(id -u) in
0)
left=$(echo « | iconv -f UTF-8 -t //translit)