Script to find out first day of our calender

I try to find the first day of our calender. So I used this script ...

echo -n "The week of the date 01jan0001 : "
echo -n `date -d 00010101 +%A`
echo

But its shows error

bash-3.1$ sh first_day.shThe week of the date 01jan0001 : date: invalid date `00010101'

Yo uhave a lot of assumptions that are correct.

However, try

cal 1

Our current calendar - the gragorian - started at different time in different countries - starting in October 1582.

the calendar in effect in the year "1" - which there was not one of on the calendar in effect at the time - was the the progenitor of the Julian calendar.

Gregorian calendar - Wikipedia, the free encyclopedia

I tried the same script in another system fedora 11, it works... but mine is Slackware...
shows the following errors...

echo -n "The week of the date 01jan0001 : "
echo -n `date -d 00010101 +%A`
echo

bash-3.1$ sh first_day.sh
The week of the date 01jan0001 : date: invalid date `00010101'

bash-3.1$

Anyway How to find out which day of the week was the beginning of our calender?
If it is Saturday, I just wanna display "Saturday"

Thanking you.:b:

Out of curiosity, I tested it on Fedora 12. The output was:

which was interesting. I have no clue what LMT 0001 means. Does not show up in the coreutils date source code.

The reality is that any output from the date command is meaningless. There was no concept of calendar months or even calendar years as we know them today in that era.