Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!munnari!otc!metro!ipso!craigb From: craigb@ipso.OZ (Craig Bevins) Newsgroups: comp.bugs.4bsd Subject: Re: bug in cal(1) Message-ID: <915@ipso.OZ> Date: Sun, 15-Mar-87 01:07:43 EST Article-I.D.: ipso.915 Posted: Sun Mar 15 01:07:43 1987 Date-Received: Tue, 17-Mar-87 01:30:46 EST References: <21173@styx.UUCP> <143@quacky.mips.UUCP> Reply-To: craigb@ipso.OZ (Craig Bevins) Organization: IPS Radio and Space Services. Sydney, Australia. Lines: 61 In article <143@quacky.mips.UUCP> dce@quacky.UUCP (David Elliott) writes: > Well folks, I guess it's time to add code to cal ... > ... > I guess we'd also need a -f option to say "I know what I'm doing, so don't > give me that line about what year you are giving me the calendar for". Hear, hear. Or you could use this script that I've had floating around for yonks. Can't remember where it came from ... # This is a shell archive. Remove anything before this line, # then unpack it by saving it in a file and typing "sh file". # # Wrapped by craigb@ipso.OZ on Sun Mar 15 16:03:18 AEST 1987 # Contents: cal echo x - cal.sh sed 's/^@//' > "cal.sh" <<'@//E*O*F cal.sh//' # cal: nicer interface to /usr/bin/cal echo case $# in 0) set `date`; m=$2; y=$6;; # no args - use today 1) m=$1; set `date`; y=$6;; # 1 arg - use this year *) m=$1; y=$2;; # 2 args - month and year esac case $m in ja*|Ja*) m=1;; f*|F*) m=2;; mar*|Mar*) m=3;; ap*|Ap*) m=4;; may*|May*) m=5;; jun*|Jun*) m=6;; jul*|Jul*) m=7;; au*|Au*) m=8;; s*|S*) m=9;; o*|O*) m=10;; n*|N*) m=11;; d*|D*) m=12;; [1-9]|10|11|12) ;; # numeric month *) y=$m; m="";; # plain year esac /usr/bin/cal $m $y # run the real one @//E*O*F cal.sh// chmod u=rwx,g=rx,o=rx cal.sh exit 0 -- Craig Bevins. IPS Radio and Space Services. Sydney, Australia. ACSnet: craigb@ipso CSNET: craigb@ipso.oz ARPA: craigb%ipso.oz@seismo.css.gov JANET: ipso.oz!craigb@ukc UUCP: {enea,hplabs,mcvax,prlb2,seismo,ubc-vision,ukc}!munnari!ipso.oz!craigb