#!/bin/sh - # # gpscal Version 1.3.0 - March 10 1995 # # Newsgroups: soc.culture.greek # From: dimitri@cui.unige.ch (Dimitri Konstantas) # Subject: Re: Postscript calendar (gpscal) # Organization: University of Geneva - CUI # Date: Fri, 12 Jan 1996 11:49:32 GMT # # There is a newer version of gpscal (1.2) which allows direct printing of a # complete year, inclusion of "special days" (birthdays for example of # friends) etc. (for this last feature you must edit the file itself - I will # change some day to take input either from the command line or an external # file). # # make sure this file is executable: chmod a+x gpscal # # gpscal -h help # gpscal -g -e 3 1996 print March 1996 with Greek moving holidays # gpscal -g -e -y 1997 print the whole year # gpscal -t > cal redirect output to "cal" instead of printer # # PostScript program to print calendars. # Doesn't deal well with September 1752 or before. # Includes Greek Orthodox holidays (stable and Easter based) # # Author: # Dimitri Konstantas CUI Geneva, Oct 1993. (dimitri@cui.unige.ch) # # This calendar is a modification of pscal from Pipeline Associates, Inc. # Information for Greek Holidays was extracted from Manolis M. Tsangaris gcal # # set ENVAR to PRINTER for BSD spooler, LPDEST for USG spooler # # Note: Oi giortes : Ag. Georgiou (23/4), Euagelistou Markou (25/4), # Agias Eirhnhs (5/5) einei imi-kinities: An pesoun prin apo # to pasxa metaferontai ws exis: # Agiou Georgiou: thn deytera tou Pasxa # Euagg. Markou: thn triti tou Pasxa (+2) # Agias Eirhnhs: Tin teterti tou Pasxa (+3) (not confirmed) # # ---------------------------------------------------------------------- help(){ echo "HOW TO PRINT THE CALENDAR." echo "Gpscal allows you to print a year calendar or isolated months." echo "In order to print February 1994, for example," echo "you give" echo " gpscal 2 1994" echo "if the currect year IS 1994 you can simply give" echo " gpscal 2" echo "This will print a simple English calendar on the (postscript)" echo "printer PostScript. If your printer has a different name then" echo "you can either use " echo " gpscal -P lw3 2 1994" echo "In order to print a Greek calendar (that is days and months are in" echo "Greek) you give" echo " gpscal -g 2 1994" echo "If in addition you want the Greek holidays to be printed (both" echo "stable and easter-dependent) you give" echo " gpscal -g -e 2 1994" echo "This will print a greek calendar with the major Greek holidays," echo "all written in Greek." echo "Omitting the -g option (gpscal -e 2 1994) will print an English" echo "calendar (names of months and weekdays in English) with the Greek" echo "holidays (in Greek always)" echo "For printing the complete year you must use the option -y" echo " gpscal -y 1994" echo "If you wish to include in the calendar the birthdays of friends" echo "you must use the -b option." echo "If you have problems or questions feel free to contact me :-)" echo " dimitri@cui.unige.ch" } ENVAR=PRINTER PATH=/usr/ucb:/bin:/usr/bin eval test \$$ENVAR || eval $ENVAR=PostScript export $ENVAR VERSION="gpscal Version 1.2.0 - December 15 1994" USAGE="Usage: pscal [ -Rrt ] [-b] [-g] [-e] [-P printer] [ -F hfont ] [ -f font ] [-v] [-help] [-y year | month [ year ] ]" TFONT=Times-Bold DFONT=Helvetica-Bold DTFONT=Symbol DTFONT2=Times-Roman GREEKHOLIDAYS=0 GREEK=0 ALLYEAR=0 BIRTHDAYS=0 ROTATE=90 LPR="lpr" while test $# != 0 do case $1 in -P) test $# -lt 2 && { echo "$USAGE" 1>&2; exit 1; } eval $ENVAR="$2"; shift 2;; -P*) eval $ENVAR=`echo $1 | sed -n 1s/-.//p`; shift 1;; -F) test $# -lt 2 && { echo "$USAGE" 1>&2; exit 1; } TFONT="$2"; shift 2;; -F*) TFONT=`echo $1 | sed -n 1s/-.//p`; shift 1;; -f) test $# -lt 2 && { echo "$USAGE" 1>&2; exit 1; } DFONT="$2"; shift 2;; -f*) DFONT=`echo $1 | sed -n 1s/-.//p`; shift 1;; -b) BIRTHDAYS=1; shift 1 ;; -t) LPR=cat; shift 1;; -r) ROTATE=90; shift 1;; -R) ROTATE=0; shift 1;; -e) GREEKHOLIDAYS=1 ; shift 1 ;; -g) GREEK=1 ; shift 1 ;; -v) echo "$VERSION" 1>&2 ; exit ;; -h) help 1>&2 ; exit ;; -help) help 1>&2 ; exit ;; -y) test $# -lt 2 && { echo "$USAGE" 1>&2; exit 1; } ALLYEAR=1; YEAR=$2 ; shift 2 ;; --|-) break;; -*) echo "$USAGE" 1>&2; exit 1;; *) break esac done if [ $ALLYEAR -eq 0 ] ; then test $# -gt 2 && { echo "$USAGE" 1>&2; exit 1; } case $# in 0) set `date`; case $# in 7) YEAR=$7;; 6) YEAR=$6;; esac MONTH=`case $2 in Jan) echo 1;;Feb) echo 2;;Mar) echo 3;;Apr) echo 4;; May) echo 5;;Jun) echo 6;;Jul) echo 7;;Aug) echo 8;; Sep) echo 9;;Oct) echo 10;;Nov) echo 11;;Dec) echo 12;;esac`;; 1) MONTH=$1; set `date`; case $# in 7) YEAR=$7;; 6) YEAR=$6;; esac ;; 2) MONTH=$1; YEAR=$2;; *) echo "$USAGE" 1>&2; exit 1;; esac else test $# -gt 0 && { echo "$USAGE" 1>&2; exit 1; } fi main() { test $YEAR -lt 100 && YEAR=`expr $YEAR + 1900` if [ $ALLYEAR -eq 0 ]; then doit else for MONTH in 1 2 3 4 5 6 7 8 9 10 11 12 do doit done fi } doit() { echo "Printing callendar for $MONTH - $YEAR" 1>&2 $LPR <