Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!uflorida!indri!aplcen!bink From: bink@aplcen.apl.jhu.edu (Ubben Greg) Newsgroups: comp.sources.wanted Subject: Re: year-at-a-glance Summary: cal|sed works well for this Keywords: calendar sed script Message-ID: <1157@aplcen.apl.jhu.edu> Date: 30 Apr 89 11:17:48 GMT References: <44@trwrb.dsd.trw.com> Reply-To: bink@aplcen.apl.jhu.edu (Greg Ubben) Organization: The Johns Hopkins University, Baltimore MD Lines: 48 In article <44@trwrb.dsd.trw.com> ryding@trwrb.dsd.trw.com (Mark Ryding) writes: > I was looking for a program to help plan annual leave for the government. > The program needs to print an entire year on one page with enough space > under the individual dates for a single letter to be entered. Any help > will be greatly appreciated. "cal | sed" works well for enlarging both monthly and yearly calendar pages. Here is one way of producing a 127-column by 131-line calendar: set 1989 banner " $1" cal $1 | sed ' 1,3b 4d /^$/d /[JO]/{ s/.*Mar/ January February March / s/.*Jun/ April May June / s/.*Sep/ July August September/ s/.*Dec/ October November December/ s/.\{9\}/ & /g i\ \ a\ b } s/.\{23\}/& /g s/.\{2,3\}/ &/g s/^/ / /S/!{ s/$/ / s/ \( .[^ ] \)/|\1/g s/\([0-9] \) /\1|/g h s/[^|]/ /g H; H s/| |/+----+/g s/+ [|+]/+----+/g x } /20/,/S/{ /[0-9]/G; } / 1 /,/20/{ H; g; } ' -- Greg Ubben bink@aplcen.apl.jhu.edu