Saturday, March 27, 2010

Cowsays In Slackware

# wget http://repository.slacky.eu/slackware-13.0/utilities/cowsay/3.03/cowsay-3.03-x86-4an.txz
# vi ~/.bashrc

if [ !$COWPATH ]
then
        COWPATH='/usr/share/cows/'
fi

cow_file_length=`ls -1 $COWPATH | wc -l`

RANDOM=$$ # initialized the random seed with the process id of this script
let "random_line = $RANDOM % $cow_file_length + 1"
cow=`ls -1 $COWPATH | head -n $random_line | tail -n 1`

/usr/games/fortune -a | cowsay -n -f $cow