[Tip] Smiley Face Bash Prompt

34 views
Skip to first unread message

Tha.Suresh

unread,
Dec 31, 2010, 12:43:02 AM12/31/10
to ILUG-C, KanchiLug, Linux Delhi, Mlug
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

Reply all
Reply to author
Forward
0 new messages