From: Mark Wooding Date: Fri, 8 May 2020 22:38:08 +0000 (+0100) Subject: dot/shell-rc: Use `$USER' directly now that I've set it properly. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/81ba988cc2c9639b75bdacc97419811f56f3c335?ds=sidebyside dot/shell-rc: Use `$USER' directly now that I've set it properly. Eliminate the `$user' local variable from `__mdw_set_prompt_pieces'. --- diff --git a/dot/shell-rc b/dot/shell-rc index 9ba0341..bec48d4 100644 --- a/dot/shell-rc +++ b/dot/shell-rc @@ -80,17 +80,16 @@ __mdw_set_prompt_pieces () { ## Choose the right delimiters. Highlight root prompts specially; ## 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-$(id -un)}} + local left right u tty case $(id -u) in 0) left=$(echo « | iconv -f UTF-8 -t //translit) right=$(echo » | iconv -f UTF-8 -t //translit) ;; *) - case $user in + case $USER in mdw | mwooding | nemo) u="" left="[" right="]" ;; - *) u="$user@" left="{" right="}" ;; + *) u="$USER@" left="{" right="}" ;; esac tty=$(tty) case "$__mdw_tty" in