Snytax error on If Statement--help

year=`date '+%Y'`
month=`date '+%m'`
day=`date '+%d'`
day=`expr $day - 1`

case $month in
1 | 3 | 5 | 7 | 8 | 10 | 12);;

if($day =7 ); then
$day=6
fi

4 | 6 | 9 | 11);;
if [ $day = 0 ] ; then
$day=31
fi

2);;
if [ $day = 0 ] ; then
if [ `expr $year % 4` -eq 0]; then
$day = 28
else
$day = 29
fi
fi
*) echo error: too many arguments 1>&2 ;;
esac

DATE=$year$month$day
cp $HOME/*$DATE*.log $HOME/QVGLog
cd $HOME/QVGLog
gzip *

the error message is
./call: line 9: syntax error near unexpected token `('
./call: line 9: `if($day =7 ); then'

Pls help, i've checked the syntax for if else statement on web, but cant fix it.:o

Ok i've fixed

year=`date '+%Y'`
month=`date '+%m'`
day=`date '+%d'`
day=`expr $day - 1`

case $month in
1 | 3 | 5 | 7 | 8 | 10 | 12)
if [ $day = 7 ]
then
$day=6
fi
;;

4 | 6 | 9 | 11)
if [ $day = 0 ]
then
$day=31
fi
;;

2)
if [ $day = 0 ]
then
if [ `expr $year % 4` -eq 0]
then
$day = 28
else
$day = 29
fi
fi
;;
*) echo error: Case Statement Not Run ;;
esac

DATE=$year$month$day
cp $HOME/*$DATE*log $HOME/QVGLog
cd $HOME/QVGLog
gzip *

now the problem is the case statement failed, the message is
error: Case Statement Not Run
cp: cannot stat `/sgxde/sgxaspecs7/*2008057*log': No such file or directory
gzip: *: No such file or directory

:o

please post your script with the code tags to preserve indentation. This makes it much easier to read.

the case statement did not fail. You just hit the default condition. If you don't want the code after to execute then add an exit.