Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Not needed if you are already defining PS1 (+ example)' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Not needed if you are already defining PS1 (+ example)
Authored by: joshewah on Mar 21, '08 09:06:01AM

I use the following prompt in .profile and using sudo -s does not keep it:
export PS1="\[\033[01;37m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] "

I bet you could run visudo and change something in the sudo config file to fix this globally.



[ Reply to This | # ]
Not needed if you are already defining PS1 (+ example)
Authored by: ClassicUser on Apr 19, '08 11:44:03AM
Ah, but .profile is only run for direct login shells - of which performing a sudo -s doesn't qualify, as it is merely starts a sub-shell within that same session.

If you put that same command in your .bashrc file instead, you should be better off. Also, note that several folks simply source the one file from the other - I have a grand total of one line in my .profile:

source $HOME/.bashrc

…to handle just such a provision, and ensure the same environment is established upon first login, as well as when starting sub-shells.

[ Reply to This | # ]