Sponsored Content
Full Discussion: Help with if-then-else
Top Forums Shell Programming and Scripting Help with if-then-else Post 88140 by ssmiths001 on Tuesday 1st of November 2005 11:46:11 AM
Old 11-01-2005
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.

Code:
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;

 
MURMUR(1)							Museek Daemon Plus							 MURMUR(1)

NAME
Murmur - PyGTK2 client for museek SYNOPSIS
murmur [-c --config <filename>] [-l --log <directory>] [-v] [--version] [-d] [-h] [--help] DESCRIPTION
Murmur provides a GTK2 interface for the Museek Daemon for chatting, transferring files, managing users, viewing user info and browsing shares on the Soulseek P2P network and Soulfind Servers. You will need a configured and running museekd(1). OPTIONS
Murmur accepts the following options: -c <filename>, --config <filename> Use a different config file. -l <directory>, --log <directory> Use a different chat log directory. -v, --version Display Version and exit. -d Display debug messages while running. -h, --help Display Help and exit. EXAMPLE
To run this program the standard way type: murmur Alternativly you use a different config file with: murmur --config config Or a different chat logging directory with: murmur --log logdir FILES
~/.murmur/config The default location for the mucous config file. ~/.murmur/logs/ The default directory for chat logs. ~/.murmur/logs/room/ The directory where chat room logs are stored. ~/.murmur/logs/private/ The directory where private chat logs are stored. ~/.murmur/$USER.$EXT The file where a user's userinfo image is saved. AUTHORS
daelstorm <daelstorm@gmail.com> SEE ALSO
mulog(1) muscan(1) muscand(1) museekcontrol(1) museekd(1) museeq(1) musetup(1) musetup-gtk(1) daelstorm Release 0.3.1 MURMUR(1)
All times are GMT -4. The time now is 11:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy