Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!


Click here to return to the '10.5: Fix the sudo shell prompt' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
10.5: Fix the sudo shell prompt
Authored by: corienti on Wed, Mar 19 2008 at 6:02PM PDT
For what it's worth, this is what I use. Customise colours to preference.
(note colours range from 31 to 36, and 01 and 00 indicate bold/nonbold.


if [ "${USER}" = "root" ]; then
USER_COL="01;31"; PATH_COL="01;33"
else
USER_COL="01;33"; PATH_COL="01;32"
fi
HOST_COL="01;37"
export PS1="\n\[\e[${USER_COL}m\]\u @ \[\e[${HOST_COL}m\]\h > \[\e[${PATH_COL}m\]\w/\[\e[0;38m\]\n-> "
unset HOST_COL PATH_COL USER_COL



[ Reply to This | # ]