There are many text formatting programs that would do this sort of thing. It's also fairly simple to write an ugly script (doesn't break on lines greater than the screen width):
Code:
#!/usr/bin/perl -w
use strict;
my $screen_width = 100;
for my $line (<>) {
my $line_length = length $line;
my $whitespace = $screen_width/2 - $line_length / 2;
print " " while ($whitespace-- > 0);
print $line;
}
Just pipe in whatever you like. I hardcoded the screen width because, for reasons unbeknownst to me, my script doesn't receive the $COLUMNS environment variable. Season to taste.
(As I was previewing this, I noticed someone else was also bored hahaha! edit: ooh stty ... I'm asleep at the wheel.)