Hi All

I have been using a some bash scripts for years which have worked perfectly (or so I thought).

This morning I went to copy some of the logic out of them and it is returning strange results.

Basically what I these are supposed to do is to set to dates, the first for the first day of the previous month and the second to set the last day of the previous month.

Here is what I have been using:

DAYS=`date +%e`
let "XDAYS=DAYS -1"
FIRSTDAY=`date --date="$XDAYS days 1 month ago" +%d%m%y`

Running this today (4th April 2001) returned 070311. I will swear blind that in the past it would have returned 010311.

Does anyone out there know if:

a) The date behaviour in CentOS has changed or
b) The rules of date calculation or maths has changed (and nobody told me)?

Alternatively, more "sure" methods would be happily considered.

Thanks and Regards

Nigel.

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to