need a help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting need a help
# 1  
Old 01-21-2009
need a help

I have a script as below


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
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



when i am running it i am getting following error....
what could be the reason...?

gpostw@bbmksm10c06::/etltst/GPOS/work_06/QWP/compassCatchUp>ISSUE.sh
+ PROJ=/etltst/GPOS/work_06/QWP/compassCatchUp/
+ export PROJ
+ ParameterFile=SAG
+ [ ! -f /etltst/GPOS/work_06/QWP/logs/SAGAR ]
+ EXIT_STATUS=99
+ cut -d = -f2
+ grep X= /etltst/GPOS/work_06/QWP/compassCatchUp/SAG
+ eval X=0
+ X=0
+ + expr 0 + 1
X=1
+ EXIT_STATUS=99
./ISSUE.sh[29]: syntax error at line 51 : `"' unmatched
# 2  
Old 01-21-2009
please distinct the line 51.
# 3  
Old 01-21-2009
Line 51 is

echo "SAGAR"
# 4  
Old 01-21-2009
please distinct the line 29 too.
# 5  
Old 01-21-2009
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 ]---->this is line no 29
# 6  
Old 01-21-2009
X=`expr $X + 1` modify this line to X=expr $X +1 , whith out backtic
# 7  
Old 01-21-2009
Code:
Missing closing quote here?

echo "No files for days=$X >> SAG

Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question