avoid forking subshell to test if user is root

This commit is contained in:
Suraj N. Kurapati committed 2011-01-08 18:15:57 -08:00
1 parent 7a9cc19819
commit 8d2b9d10e5
7 files changed
+7 -7

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
if [ "$(whoami)" = "root" ]; then NCOLOR="red"; else NCOLOR="yellow"; fi
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="yellow"; fi
PROMPT='%{$fg[$NCOLOR]%}%c ➤ %{$reset_color%}'
RPROMPT='%{$fg[$NCOLOR]%}%p $(git_prompt_info)%{$reset_color%}'