Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: notesfiles Path: utzoo!linus!philabs!prls!amdimage!amdcad!amd!pesnta!hplabs!hp-pcd!hpfcla!ajs From: ajs@hpfcla.UUCP (ajs) Newsgroups: net.sources Subject: Re: Orphaned Response Message-ID: <43600021@hpfcla.UUCP> Date: Sat, 11-May-85 15:43:00 EDT Article-I.D.: hpfcla.43600021 Posted: Sat May 11 15:43:00 1985 Date-Received: Mon, 20-May-85 04:20:07 EDT References: <-149000@dalcs.UUCP> Organization: Hewlett-Packard - Fort Collins, CO Lines: 77 Nf-ID: #R:dalcs:-149000:hpfcla:43600021:37777777600:1699 Nf-From: hpfcla!ajs May 13 11:43:00 1985 Re: big calendar printer Just for grins, here's something similar, but it's a shell script which uses cal(1) and awk(1) to do the job. I call it "calbig". # Script to produce big (page sized) calendars from cal(1) output. # Input data looks like this (for example): # # November 1983 # S M Tu W Th F S # 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 29 30 note: this line may be short. # Check arguments: case $# in 0) months=`date +%m` # default to current. year=19`date +%y` ;; 1) months="1 2 3 4 5 6 7 8 9 10 11 12" # whole year. year="$1" ;; 2) months="$1" # one month. year="$2" ;; *) echo "usage: $0 [[month(s)] year]" >&2 # error. exit 1 esac # Print calendars: for month in $months do cal $month $year | awk ' BEGIN { days = \ " Sunday Monday Tuesday Wednesday Thursday Friday Saturday " top = \ " _________ _________ _________ _________ _________ _________ _________ " bar = \ "|_________|_________|_________|_________|_________|_________|_________|" cols = \ "| | | | | | | |" } /S M Tu W Th F S/ { # start of month header. printf ("%s\n%s\n", days, top); next; } /[a-z]/ { # a month title. printf ("\n\n\n\t\t\t%s %s\n\n\n", $1, $2); next; } /[0-9]/ { # a number line. line = $0 " "; # pad it. for (col = 1; col < 20; col += 3) printf ("| %2s ", substr (line, col, 2)); printf ("|\n"); for (row = 2; row < 8; row++) print cols; print bar; } ' | sed "s/^/ /" # indent one tab. echo "\f\c" # end page. done