write bash script cowsay |fortune

write in sudo nano bash_profile:

#!/bin/bash

# This script gets a random available cow with `cowsay -l` and prints some text, default fortune

FORTUNE=”fortune”

for COWNAME in `cowsay -l | tail -n +2`
do
COWS+=$COWNAME
COWS+=’\n’
done
COWS=${COWS%??}
RANDOMCOW=$(echo -e $COWS | sort -R | head -n 1)

$FORTUNE | cowsay -f $RANDOMCOW

(thanks to https://askubuntu.com/questions/16428/showing-a-cowsay-fortune-in-every-new-terminal-session and to https://pastebin.com/f0QXTPbt)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s