Thanks... I use this line:
export PS1="\h:\w \u\$> "
.. but when I "su" to root, it still writes $ as the groupsign
eventhough it should have been a #? /u writes correctly the username as
root.
I have this in my /etc/profile:
if [ `/usr/bin/whoami` = 'root' ]
then
# Do not set PS1 for dumb terminals
if [ "$TERM" != 'dumb' ] && [ -n "$BASH" ]
then
export PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$
\[\033[00m\]'
fi
export PATH="/bin:/sbin:/usr/bin:/usr/sbin"
else
# Do not set PS1 for dumb terminals
if [ "$TERM" != 'dumb' ] && [ -n "$BASH" ]
then
export PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$
\[\033[00m\]'
fi
export PATH="/bin:/usr/bin:${PATH}"
fi
note the export statements should all be on one line. Use 'su -' when
switching users. The above colourises the prompt too if you are into
that sort of thing.
Cheers,
Pip
It is still the same (it really does nothing else than changing some
colors).
I don't know if I have misunderstood your question having joined so
late. If the problem is simply that as root your prompt doesn't end
with a '#' then the code I gave you should work. Maybe a good read of
the manual for your shell would turn up more intelligent and indeed
useful answers than I can.
Cheers,
Pip