avoid forking subshell to test if user is root

This commit is contained in:
Suraj N. Kurapati 2011-01-08 18:15:57 -08:00
commit 8d2b9d10e5
7 changed files with 7 additions and 7 deletions

View file

@ -1,4 +1,4 @@
if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="white"; fi
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="white"; fi
PROMPT='%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[blue]%}%B%c/%b%{$reset_color%} $(git_prompt_info)%(!.#.$) '
RPROMPT='[%*]'