From 81ba988cc2c9639b75bdacc97419811f56f3c335 Mon Sep 17 00:00:00 2001 Message-Id: <81ba988cc2c9639b75bdacc97419811f56f3c335.1717825387.git.mdw@distorted.org.uk> From: Mark Wooding Date: Fri, 8 May 2020 23:38:08 +0100 Subject: [PATCH] dot/shell-rc: Use `$USER' directly now that I've set it properly. Organization: Straylight/Edgeware From: Mark Wooding Eliminate the `$user' local variable from `__mdw_set_prompt_pieces'. --- dot/shell-rc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 -- [mdw]