[clug] CLUG meeting 21 August 2003

Michael Still mikal at stillhq.com
Mon Aug 18 06:48:40 EST 2003


On Mon, 18 Aug 2003, Brad Hards wrote:

> By my calendar ( http://korganizer.kde.org/ ), that is only the third 
> Thursday. I'd normally not be too worried (heh, as long as it happens!) but 
> I'm away this week, so I'd prefer it on the 28 Aug.

Hey, that's twice in one year! I stand corrected. So, here's the script 
that generates that email:

-------
#!/bin/bash

export day=`date +"%d"`
export month=`date +"%B"`
mon=`date +"%m"`
export year=`date +"%Y"`

thurs=`cal $mon $year | head -6 | tail -1 | cut -f 5 -d " "`
nthurs=$(( $day + 3 ))
export thurs

if [ $nthurs = $thurs ]
then
  ./subst.pl < template | mail -s "CLUG meeting $thurs $month $year" mikal
else
  echo "nothing" | mail mikal
fi
-----

As a challenge, anyone care to fix it so that months with no Thursday on 
the first line don't cause this bug?

Cheers,
Mikal

-- 

Michael Still (mikal at stillhq.com) | Stage 1: Steal underpants
http://www.stillhq.com            | Stage 2: ????
UTC + 10                          | Stage 3: Profit




More information about the linux mailing list