I am in the midst of learning Linux, specifically the BASH Shell. I have been trying to edit the initialization files so that whenever I su into root, my prompt will turn red. I am using the code posted below. I am placing the code into the .bashrc file, but have also tried /etc/profile and .bash_profile. If I manually source the files my prompt will turn red for root only like I want, however, if I issue su without sourcing my prompt remains unchanged?
if [ $EUID -eq 0 ]; then
PS1='\e[0;31m[\u@\h \W]\$ \e[m'
else
PS1='[\u@\h \W]\$ '
fi