Just moved over to ubuntu land from fedora (wanted try the budgie build).
I'm fed land I had a script (from Fedy - posted below.) that changed my prompt to red when I logged into the root shell with sudo -s
, this doesn't appear to work in Ubuntu even though I have the following the /etc/sudoers
file:
Defaults env_reset
Could one of you kind folks point out what is blocking or overwriting the export PS1
?
Output of cat /etc/profile.d/color_prompt.sh
:
# Colors in Terminal (Bash)
if [[ ! -z \$BASH ]]; then
if [[ \$EUID -eq 0 ]]; then
PS1="\[\033[33m\][\[\033[m\]\[\033[31m\]\u@\h\[\033[m\] \[\033[33m\]\W\[\033[m\]\[\033[33m\]]\[\033[m\] # "
else
PS1="\[\033[36m\][\[\033[m\]\[\033[34m\]\u@\h\[\033[m\] \[\033[32m\]\W\[\033[m\]\[\033[36m\]]\[\033[m\] \$ "
fi
fi
sudo -s
to login as root. Usesudo -i
and get clean environment. – muru Apr 14 '17 at 13:51-i
, and that might be a difference between Fedora & Ubuntu. – JonBrave Apr 14 '17 at 13:53==
in the test instead of-eq
– Zanna Apr 14 '17 at 14:01==
is string comparison,-eq
is integer comparison, which throws an error if one of the candidates can not be interpreted as a number. I think both ways are acceptable here. – Byte Commander Apr 14 '17 at 14:10