#!/usr/bin/perl -w # # Congratulate the user sort of personally. # # 2006-02-??: Written by Steven J. DeRose. # 2010-09-14 sjd: Clean up. # use strict; if ($ARGV[0] && $ARGV[0] =~ /^-h/) { system "perldoc congrats"; exit; } my $fingerLine = `finger -s $ENV{USER} | tail -n 1`; chomp($fingerLine); $fingerLine =~ s/[^ ]* +//; $fingerLine =~ s/ .*//; print "\nCongratulations, $fingerLine.\n"; exit; ############################################################################### # sub showUsage { print " =head1 Usage congrats Looks up the user's first name, and congratulates them. =head1 Ownership This work by Steven J. DeRose is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License. For further information on this license, see http://creativecommons.org/licenses/by-sa/3.0/. The author's present email is sderose at acm.org. For the most recent version, see http://www.derose.net/steve/utilities/. "; }