Logiciel Libre

January 6, 2006

The Helpful Smiley

Filed under: Uncategorized — Tags: — adam @ 10:43 pm CST

Check out my latest toy:

:) compost$ ls
foo    bar    baz
:) compost$ blarf
bash: blarf: command not found
:( 127 compost$

Here’s What’s in my ~/.bashrc:

smiley() {
   err=$?
   if [ $err == 0 ]
   then echo ":)"
   else echo ":( $err"
   fi
}

PS1="\$(smiley) \h\\$ "

This reminds me of the face that reports your remaining health percentage in the original version of “Doom”…

(Well, ok, so that was an XDoom screen capture)

1 Comment »

  1. I can’t believe I never thought to do this. You had me laughing for five minutes tonight. I might have to put it in /etc/profile on a few systems.

    Comment by yDNA — January 7, 2006 @ 10:46 pm CST

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress