if-else syntax in csh

Dear friends,

I am writing a script usiing c-shell.

iwant if -else syntax in c-shell
i have taken twovariables and in one variable iam storing sysdate.and comparing with other variable

if both are same then iam renaming file as oct_2005.

please see below code

set mon=`date +%m`
set yer=`date +%Y`
set dat=`date +%d`

set pass=`cal $mon $yer | sed '/^$/d' | tail -1 | awk '{printf $NF}'`
echo $pass
set vrfir=`expr $pass - 1`
echo $vrfir
echo $dat
echo $pass

if test $dat == $vrfir ; then
mv schedule $montmp$yer
#else
#mv schedule $montmp$yer
fi

regards
rajan

I am not a csh programmer, in fact this will probably turn you away from it as well.

Anyway, the syntax for 'if' in csh is like this:

if ($dat == $vrfir) then
   echo foo!
else
   echo bar!
endif