Help with if-then-else

Does anyone see something wrong with this statement? I am getting a "syntax error at line 30 : `else' unmatched" error.

dayofweek=`date +%w"-"%a`
echo "DayofWeek  = " $dayofweek

if [ $dayofweek -eq "1-Mon" ] ; then
      logdir=/opt/batch/$1/logs/$dayofweek
else if [ $dayofweek -eq "2-Tue" ] ; then
      logdir=/opt/batch/$1/logs/$dayofweek
else if [ $dayofweek -eq "3-Wed" ] ; then
      logdir=/opt/batch/$1/logs/$dayofweek
else if [ $dayofweek -eq "4-Thu" ] ; then
      logdir=/opt/batch/$1/logs/$dayofweek
else if [ $dayofweek -eq "5-Fri" ] ; then
      logdir=/opt/batch/$1/logs/$dayofweek
else if [ $dayofweek -eq "6-Sat" ] ; then
      logdir=/opt/batch/$1/logs/$dayofweek
else if [ $dayofweek = "7-Sun" ] ; then
      logdir=/opt/batch/$1/logs/$dayofweek
fi;

There are only seven days in a week. No matter which day it is, you seem to do the same thing. That does not make sense. But "else if" should be "elif" provided that I correctly guessed at which shell you're using. And that trailing semicolon is superfluous.

I have logfile directories for each day of the week. I'm using Korn shell.

But you have a variable set to the day of the week!
logdir=/opt/batch/$1/logs/$dayofweek # on Monday you use this
logdir=/opt/batch/$1/logs/$dayofweek # on Tuesday you use this
It is the same command being executed on each day of the week. The value in $dayofweek is changing and that is all that needs to change.

OK, now I understand what you are saying. Thanks for the help.