OT ? Shell script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



How about something like:

YEAR=2005
MONTH=12
for ((DAY=1;DAY<=31;++DAY)); do
   LC_ALL=C TZ=UTC date -d "$YEAR-$MONTH-$DAY"
done | grep "^Mon " | head -n 3 | tail -n 1

Possibly without the TZ=UTC depending on your needs...

Cheers
MaZe?

On Sun, 4 Dec 2005, Robert wrote:

> Does anyone have an elegant solution for finding the date of the 3rd Monday 
> each month and the date of the Sunday preceding?  (Sunday shouldn't be beyond 
> my capabilities, once the Monday part is worked out.)
> For the past several years, I've been handling the chore using a file with a 
> manually input list of dates -- which is about as elegant as driving a tack 
> with a sledge hammer.
> _______________________________________________
> CentOS mailing list
> CentOS@xxxxxxxxxx
> http://lists.centos.org/mailman/listinfo/centos
>

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux