Home » Development » Geektool » Calendar
This script will output a calendar with the current date surrounded in brackets.
cal.pl
#!/usr/bin/perl use Shell; my $sh = Shell->new; my $cal = $sh->cal(); my $date = $sh->date('+%d'); $date =~ s/\n//; if($sh->date('+%A') =~ m/Saturday/){ if($date < 10){ $cal =~ s/ $date/\[ $date\]/; } else { $cal =~ s/ $date/\[$date\]/; } } else { if($date < 10){ $cal =~ s/ $date /\[ $date\]/; } else { $cal =~ s/ $date /\[$date\]/; } } print $cal;
Execute using:
perl cal.plSample Output:
February 2009 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17[18]19 20 21 22 23 24 25 26 27 28