dot/shell-rc: Use `$USER' directly now that I've set it properly.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 8 May 2020 22:38:08 +0000 (23:38 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 13 May 2020 17:31:10 +0000 (18:31 +0100)
Eliminate the `$user' local variable from `__mdw_set_prompt_pieces'.

dot/shell-rc

index 9ba0341..bec48d4 100644 (file)
@@ -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