From owner-freebsd-questions@FreeBSD.ORG Mon Oct 20 14:09:01 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C58B616A4B3 for ; Mon, 20 Oct 2003 14:09:01 -0700 (PDT) Received: from mxsf09.cluster1.charter.net (mxsf09.cluster1.charter.net [209.225.28.209]) by mx1.FreeBSD.org (Postfix) with ESMTP id D822843F3F for ; Mon, 20 Oct 2003 14:09:00 -0700 (PDT) (envelope-from chowse@charter.net) Received: from moe (jackson-66-168-145-25.midtn.chartertn.net [66.168.145.25]) h9KL8q55046683 for ; Mon, 20 Oct 2003 17:08:56 -0400 (EDT) (envelope-from chowse@charter.net) From: "Charles Howse" To: Date: Mon, 20 Oct 2003 16:08:50 -0500 Message-ID: <000201c3974e$5f352eb0$04fea8c0@moe> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal Subject: Re: Hacking calendar(1) - SOLVED X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2003 21:09:01 -0000 >> When I get my daily calendar email, there is no explanation of which >> entries come from which calendars. >> Other than hacking the source code, is there a way to get some headers >> like this?=20 >>=20 >> Music History: >> Oct 20 Three members of Lynyrd Skynyrd die in a plane crash, 1977 >>=20 >> World History: >> Blah blah blah >>=20 >> Computer History: >> Blah blah blah > > Not really. > The only cheap-and-easy hack I can think of is to modify (each line > of) the calendar files themselves. I found an old post by Greg Lehey that I have modified. I run it from cron at midnight every day. It's working great so far! Comments, suggestions? --------------------- #!/usr/local/bin/bash # # Go through the calendars and find out what happened today. dir=3D/usr/share/calendar file=3D/root/today_cal if [ -a $file ] ; then rm $file fi if [ -n "`/usr/bin/calendar -f $dir/calendar.birthday`" ] ; then echo "Birthdays:" >> $file /usr/bin/calendar -f $dir/calendar.birthday >> $file echo >> $file fi if [ -n "`/usr/bin/calendar -f $dir/calendar.christian`" ] ; then echo "Christian:" >> $file /usr/bin/calendar -f $dir/calendar.christian >> $file echo >> $file fi if [ -n "`/usr/bin/calendar -f $dir/calendar.computer`" ] ;then echo "Computer:" >> $file /usr/bin/calendar -f $dir/calendar.computer >> $file echo >> $file fi if [ -n "`/usr/bin/calendar -f $dir/calendar.music`" ] ; then echo "Music:" >> $file /usr/bin/calendar -f $dir/calendar.music >> $file echo >> $file fi if [ -n "`/usr/bin/calendar -f $dir/calendar.usholiday`" ] ; then echo "U.S. Holidays:" >> $file /usr/bin/calendar -f $dir/calendar.usholiday >> $file fi cat $file | mail -s "Today's Calendar" charles --------------------- Output of today's email: Birthdays: Oct 21 Alfred Nobel born in Stockholm, 1833 Computer: Oct 20 Zurich ALGOL report published, 1958 Music: Oct 20 Three members of Lynyrd Skynyrd die in a plane crash, 1977 Thanks, Charles Got a computer with idle CPU time? Join SETI@home and help make history! http://setiathome.ssl.berkeley.edu/