[Smaug] A quick scripting puzzle
cerise@armory.com
cerise at armory.com
Thu Nov 17 22:11:40 PST 2005
I can top that! This is 59 chars.
LASTSUNDAY=`cal | grep [0-9] | sed s/[ ].*//g | tail -n 1`
-Phil/CERisE
On Thu, Nov 17, 2005 at 09:13:01PM -0800, Jay Campbell wrote:
>
> You'd have to escape the backticks to use this inside the
> LASTSUNDAY example backticks, and on re-parsing the question
> it asked for the date, not just day-of-month, so you'd have
> to tack more characters into the second `date`s format string.
>
> So I'm over 80 characters anyway. The practice of shaving bytes
> off code like this is called 'golfing' in some circles (i.e. perl)
>
> j
More information about the Smaug
mailing list