[Nottingham] Colourful smiley prompts for your commandline
Martin
martin at ml1.co.uk
Mon Jul 26 14:17:22 UTC 2010
Folks,
A nice little snippet I've just rediscovered:
####
# ML smiley prompts
if [[ ${EUID} == 0 ]] ; then
PS1="\[\033[01;31m\]\h\[\033[01;34m\] \W \$([ \$? = 0 ]
&& echo '\[\033[01;32m\]:)' || echo '\[\033[01;31m\]:(') \\$\[\033[00m\] "
else
PS1="\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$([ \$? = 0
] && echo '\[\033[01;32m\]:)' || echo '\[\033[01;31m\]:(') \\$\[\033[00m\] "
fi
####
Note: The PS1 lines are all one line, no line breaks!
Add that onto the end of your ~/.bashrc and voilà! You get nice
colourful smiley prompts that give a green smile upon a successful
command and a red frown if failed. :-)
At least I find it useful as a prompt to show whether the previous
command completed ok.
Hope of use,
Cheers,
Martin
--
----------------
Martin Lomas
martin at ml1.co.uk
----------------
More information about the Nottingham
mailing list