Solved Problem with prompt on root account

I've been making changes to my system that involved switching my default user shell from sh to csh. This has worked nicely because I have got the correct path settings at last. However, somewhere along the line I managed to trash my /root/.cshrc. I have tried to fix this by copying my ~/.cshrc to /root/.cshrc. The problem is that when I su to root in the terminal, my prompt is showing this...

Screen Shot 2018-03-20 at 02.18.39.png


As you can see, the first line is fine. I'm logged in as carlcaulkett and the prompt is displaying correctly. Then I do an su to switch to root. My prompt changes to show that the current directory is not the $HOME directory anymore, but it doesn't reflect the fact that the account name has changed. The whoami confirms that the account has actually changed.
This is from my /root/.cshrc...

Screen Shot 2018-03-20 at 02.28.04.png


I'm sure it's something trivial but what am I missing?
 
Last edited:
man su would suggest you should use a switch to discard your existing environment.

Forgive me I'm not quite sure what you mean by this. All I know is that previously when I changed from user to root, the prompt would change to reflect that change. Now the prompt is not changing.
 
I understand what you mean by man su and I've been looking through that, but it's very late here and I'm really tired. Any chance of an explanation in single syllables (or less!) to give me a chance!
 
Aha! I did read on! ls -l seems to do the trick. Maybe my changing the user shell to csh changed the behaviour of sh. Thank you.

I added alias su su -l so I don't have to remember the -l switch!
 
Back
Top