Wednesday, June 05, 2013

A shift calendar with Perl

You are told, provide me the availability from/to date for the team members that would be on call to provide support in weekdays. So you create a file with the initials (max three letters) of the team members:
$ cat initials.txt
JP
PP
NUR
JA
FOO
BAR 
And then just use this script to generate the below output:
$ ./shift-cal.pl 12 2013 initials.txt

December 2013

Su       Mo       Tu       We       Th       Fr       Sa
         2-JP     3-PP     4-NUR    5-JA     6-FOO             
         9-BAR    10-JP    11-PP    12-NUR   13-JA             
         16-FOO   17-BAR   18-JP    19-PP    20-NUR            
         23-JA    24-FOO   25-BAR   26-JP    27-PP             
         30-NUR   31-JA                                        
 
In Ubuntu here is how to install the dependencies:
sudo apt-get install libcalendar-simple-perl 

No comments:

Followers