The syntax in Bash for such a complicated statement becomes awkwrd in Bash:
if [ \( $1 = Feb -a $2 -gt 28 \) -o \( $1 = Feb -a $2 -gt 29 -a $(($3 % 4)) -eq 0 \) ];
It is better to split the statement in a number of separate tests and test the outcome of those tests like:
if [ $1 = Feb -a $2 -gt 28 ]; then
modyear=$(($3 % 4))
if [ $1 = Feb -a $2 -gt 29 -a $modyear -eq 0 ]; then
if [ $L28 -eq 1 -o $DIV4 -eq 1 ]; then
This is by far not the most efficient way to write, but it is much clearer. Also run your script with sh -x yourscript
to obtain debugging information.
Also remember that if Year % 100 == 0, you must find Year % 400 to determine a leap year. Imagine the nightmare if you want to put all that in a single statement.
Are you sure you are required to do this Bash arithmetic? Otherwise you might want to take a look at the 'date' command.