Randomized .signature file

Here’s a quicky. I like to have a random quote in my signature, but most mail clients only read a static file, and trying to fool them with a command pipe socket is tricky, and often has other issues. So I wrote this little bit of magic:

#!/usr/bin/perl
 
my $fortune = '';
 
do {
	$fortune = `fortune -e -s -n 480 bofh-excuses calvin chalkboard chucknorris computers cookie definitions discworld dune firefly fortunes hitchhiker homer kids law linux magic mormon paradoxum perl pets riddles science scriptures smac startrek starwars taow work`;
} while ($fortune =~ /filter|these|words|out/);
 
print "Matthew Walker                      h: (xxx) xxx-xxxx\n";
print "Software Architect                  m: (xxx) xxx-xxxx\n";
print "Marketecture                        e: fake_email\@domain.com\n\n";
 
print $fortune;

Replace the ‘filter|these|words|out’ bit with a | seperated list of words you don’t want to show up in your fortunes, and adjust the fortune command however you want to tune the type of quotes you get. Then install it as a cron job like this:


* * * * * perl ~/.signature.pl > ~/.signature

There you go! Your .signature file will get regenerated once a minute with a new random quote. Enjoy.

%d bloggers like this: