[kanchilug] [Tip] Smiley Face Bash Prompt

  • From: "Tha.Suresh" <jemenisuresh@xxxxxxxxx>
  • To: ILUG-C <ilugc@xxxxxxxxxxxxx>, KanchiLug <kanchilug@xxxxxxxxxxxxx>, Linux Delhi <iitdlug@xxxxxxxxxxxxxxxx>, Mlug <glug-meerut@xxxxxxxxxxxxxxxx>
  • Date: Fri, 31 Dec 2010 11:13:02 +0530

Smiley Face Bash Prompt

$ PS1="\`if [ \$? = 0 ]; then echo \[\e[34m\]^_^\[\e[0m\]; else echo
\[\e[31m\]O_O\[\e[0m\]; fi\`[\u@\h:\w]\\$ "

If your last command was a dud, your bash prompt will be angry at you.
Otherwise it's happy. Soon you will crave its constant approval and
your linux skills will improve simply to avoid low self-esteem.

To set this as default, edit your ".bashrc" file and add it.

Ex:

^_^[Student@mercury:~]$ echo "Linux Rockzzz"
Linux Rockzzz
^_^[Student@mercury:~]$ ;echo "You want windows"
bash: syntax error near unexpected token `;'
O_O[Student@mercury:~]$ echo "hehe"
hehe
^_^[Student@mercury:~]$





--
Regards,
Tha.Suresh

Cooool Linux Tips & Tricks,
http://gnutips.wordpress.com

My experiences with Linux are here,
http://thasulinux.wordpress.com
 

Other related posts:

  • » [kanchilug] [Tip] Smiley Face Bash Prompt - Tha.Suresh