First, use [code]-tags the next time you post code, makes it easier to read
Second, compare your code with that below
Third, your posted code seems to have an unmatched "fi"
Code :
set -x
PROJ="/etltst/GPOS/work_06/QWP/compassCatchUp/"
export PROJ
ParameterFile="SAG"
if [ ! -f /etltst/GPOS/work_06/QWP/logs/"SAGAR" ]; then
EXIT_STATUS=99
fi
eval X=`grep "X=" ${PROJ}${ParameterFile}|cut -d "=" -f2`
X=`expr $X + 1`
EXIT_STATUS=99
if [ $EXIT_STATUS -eq 99 ]
then
echo "No files for days=$X" >> SAG #Missed a closing quote here
break
elif [ $EXIT_STATUS -eq 98 ]
then
error_msg="FTP FAILED : A file or directory in the path name does not exist Or Connot Login "
break
elif [ $EXIT_STATUS -eq 97 ]
then
error_msg= "FTP FAILED : No such file or directory Or Invalid Command"
break
elif [ $EXIT_STATUS -eq 96 ]
then
error_msg= "FTP FAILED : Invalid IP Address"
break
fi
if [ $EXIT_STATUS -ne 0 ]
then
echo "SAGAR"
elif [ $EXIT_STATUS -eq 0 ]
then
EXIT_STATUS=0
fi
return ${EXIT_STATUS}
fi