Date: Mon, 01 Mar 2010 22:27:08 -0700 (MST) From: "M. Warner Losh" <imp@bsdimp.com> To: rdivacky@freebsd.org Cc: src-committers@freebsd.org, svn-src-user@freebsd.org, edwin@freebsd.org Subject: Re: svn commit: r204479 - user/edwin/ncal Message-ID: <20100301.222708.986891133540166335.imp@bsdimp.com> In-Reply-To: <20100228205005.GA4003@freebsd.org> References: <201002282036.o1SKaPUI085762@svn.freebsd.org> <20100228205005.GA4003@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20100228205005.GA4003@freebsd.org>
Roman Divacky <rdivacky@FreeBSD.org> writes:
: On Sun, Feb 28, 2010 at 08:36:25PM +0000, Edwin Groothuis wrote:
: > Author: edwin
: > Date: Sun Feb 28 20:36:24 2010
: > New Revision: 204479
: > URL: http://svn.freebsd.org/changeset/base/204479
: >
: > Log:
: > Do some work on ncal while we're at it.
:
: I have a patch that implementes "cal -3" are you interested in it?
I can finally get of my script then :)
Warner
#!/bin/sh
########
# cal3 - 3-month calendar printer
########
case $# in
0|1) eval `date "+M=${1:-%m} Y=${2:-%Y}"`;;
2) M=$1 Y=$2;;
*) echo "Usage: $0 [month [year]]" >&2; exit 2;;
esac
bc <<! | xargs -n2 cal | pr -3 -t -l8
m=$M; y=$Y
if (m>1) {m-1; y}; if (m==1) {12; y-1} /* prev month */
m; y /* this month */
if (m<12) {m+1; y}; if (m==12) {1; y+1} /* next month */
!
exit 0
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100301.222708.986891133540166335.imp>
