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


Click here to return to the 'custom root shell prompt are for wimps!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
custom root shell prompt are for wimps!
Authored by: Anonymous on May 18, '01 01:34:06PM

This is a philosophical stance, not technical. Having said that, I'd leave the root prompt alone. Putting all that stuff in encourages a certain amount of laziness and sloppiness that you should never have when working as root. Getting used to a customized prompt also messes you up if you ever have to do any work as root on another system that doesn't have your customizations. Heck, this even happens with Mac folks who aren't working on their own systems, especially if they have to deal with someone else's customizations. :-)



[ Reply to This | # ]
custom root shell prompt are for wimps? NOT!
Authored by: skab on May 21, '01 11:07:29AM

>custom root shell prompt are for wimps!

Just like safety belts or airbags. Well...

I disagree, it can't hurt to change your su-prompt to something that reminds you of being logged in as root. And if you say "if you're focused on what you're doing, you KNOW that you're logged in as root, if you ain't, just don't do it", you never had to change something in your system after hacking all night on some piece of code and fell into this kind of programming coma when you are sort of driving on auto-pilot...

Having said that, the maybe most elegant way of globally changing your prompt is using the xxx.mine files in /usr/share/init/tcsh, not a .tcshrc file in anyone's homedir. Put this "rc.mine" file in there:

if ($?prompt) then # For interactive shells only (ie. not scripts):
if ($uid) then
set prompt="(%n@%m:%B%/%b)%# "
else
set prompt="(%{



[ Reply to This | # ]
custom root shell prompts are for wimps!
Authored by: Anonymous on May 21, '01 04:17:51PM

If you are logged in as a normal user, Bourne-style shells use '$' as the default command-line prompt. C shell, tcsh (the default for OS X), and other derivatives use '%'. If you are logged in as the superuser, the prompt changes to '#'.

Of course, if you're not sure whether you are logged in as a normal user or as the superuser, use other commands like 'whoami' or 'id' to find out --- and don't trust the prompt!



[ Reply to This | # ]