[Beds] Meeting and script challenge
Steven Goodwin
steev at tuls.pauken.co.uk
Fri Jan 14 16:05:18 GMT 2005
On Mon, Jan 10, 2005 at 09:50:52PM +0000, Lee Larcombe wrote:
> I will be coming to the meeting on thurs. I have also done you a
> script
> for your challenge in perl below.
> It just need to be run as a daily cron.
[ perl snipped ]
And here was me using a proper language <gd&r>
My first part, FWIW, uses a small script (getday.sh) that reads:
date '+%m %Y' | ncal -w | head -n $1 | tail -n 1 | tr -s " " | cut -d "
" -f $2
and used,
$ ./getday 5 3
Which prints to stdout the date (13th for this month) of the second (3)
Thursday (5) of the month.
A couple of pipes and subshells later (and two calls to getday) and you
have the full solution, although I never had time to finish it before I
saw your version.
Steev
(conceding defeat)
More information about the Beds
mailing list