Path: utzoo!mnetor!uunet!husc6!necntc!ncoast!allbery From: neilc@dmscanb.oz.au.UUCP (Neil Crellin) Newsgroups: comp.sources.misc Subject: PScal - PostScript Calendar generator: leap year bug fixed Message-ID: <6404@ncoast.UUCP> Date: 11 Dec 87 02:33:43 GMT Sender: allbery@ncoast.UUCP Organization: CSIRO Division of Mathematics and Statistics Lines: 245 Approved: allbery@ncoast.UUCP X-Archive: comp.sources.misc/8712/6 Dear Brandon, Could this possibly be suitable for comp.sources.misc ? It was once a net.sources submission, which has been hacked about a little. Some time ago, this really useful shell script to print a PostScript calendar was sent to net.sources. Unfortunately, it had a bug in the PostScript which meant that the calendar was wrong for leap years, certainly for Feb. 1988 onwards. It's short enough that rather than just post the diffs, I've re-sent the whole script, which here at dmscanb we call PScal. Syntax is: PScal eg. PScal 2 1988 You should change the default printer variable below. It is set at -Plaser currently. Regards, Neil Crellin (neilc@dmscanb.dms.oz.au) =-=-=-=-=-=-=-=-=-=-=-(cut here - this is not a shar)-=-=-=-=-=-=-=-=-=-=-= #!/bin/csh -f # # From: patwood@unirot.UUCP (Patrick Wood) # Newsgroups: net.sources # Subject: PostScript Calendar # Date: 7 Mar 87 18:43:51 GMT # Organization: Public Access Unix, Piscataway, NJ # # 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 # Leap year bug fixed Dec. 4th, 1987 by Neil Crellin (neilc@dmscanb.dms.oz.au) # set printer="-Plaser" top: if ($#argv > 0) then switch ("$argv[1]") case -*: set printer="$argv[1]" shift argv goto top case *: if ($?month) then set year="$argv[1]" else if ($?year) then echo "usage: $0 [-Pprinter] month year" exit 1 else set month="$argv[1]" endif shift argv goto top endsw endif if ($?year) then else echo "usage: $0 [-Pprinter] month year" exit 1 endif lpr $printer <