#!/bin/csh -f # # [Here it is... the original shell script and PostScript boilerplate that # would eventually become "pcal". Modified slightly by A. W. Rogers to # correct bug in leap year algorithm, suppress the illegible weekday names # in the small calendars, use the more common "-d" flag (instead of "-P") to # specify line printer destination, default to the current month/year, and # add the current century to years between 0 and 99.] # # Original From: patwood@unirot.UUCP (Patrick Wood) # # The following is a PostScript program to print calendars. It doesn't # work on or before 1752. # # Shell stuff added 3/9/87 by King Ables # # Made pretty by tjt 1988 # # Tim Tessin - Lawrence Livermore National Laboratory # tjt@tis.llnl.gov # Phone: (415) 423-4560 / 422-8971 # Run like the following: pscalendar -Pstrudel 4 1988 - for April 1988 # set printer="cat" top: if ($#argv > 0) then switch ("$argv[1]") case -d*: case -P*: set printer="lp "`echo $argv[1] | sed s/-P/-d/` shift argv goto top case *: if ($?month) then set year="$argv[1]" else if ($?year) then echo "usage: $0 [-dprinter] month year" exit 1 else set month="$argv[1]" endif shift argv goto top endsw endif if ($?year) then else @ month = `date +%m` @ year = `date +%Y` endif if ($year >= 0 && $year < 100) then @ year += 100 * (`date +%Y` / 100) endif cat <