[Nottingham] Colourful smiley prompts for your commandline

James Holland modestforagenius at gmail.com
Mon Jul 26 14:24:13 UTC 2010


Ugh, can't get it working. Can you use Pastebin and send a link please?

On 26 July 2010 15:17, Martin <martin at ml1.co.uk> wrote:

> 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
> ----------------
>
> _______________________________________________
> Nottingham mailing list
> Nottingham at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/nottingham
>



-- 
R. James Holland
0115 9 509 789
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/nottingham/attachments/20100726/f3aa9023/attachment.htm>


More information about the Nottingham mailing list