Problem with shell script - Error: 0403-057

Hi,
I am new to shell scripts may be the error is very very small and i am unable to catch hold of it, any suggestion would be appreciated....error is at the bottom:

+210 # get file type
+211 filetype=`tail -1 "$inputdir"/"$i"|cut -d"|" -f2`
+212 #
+213 # get the record count as specified in the file
+214 reccount=`tail -1 "$inputdir"/"$i"|cut -d"|" -f5`
+215 #
+216 #get the filaname as specified in the file
+217 filename=`tail -1 "$inputdir"/"$i"|cut -d"|" -f3`

+222
+223 #############
+224 # My_Work #
+225 #############
+226
+227 if [[ $country == "XXX" ]]
+228 then
+229 #
+230 #
+231 ###### sqlplus -s /nolog <<EOF
+232 ###### conn $user
+233 ###### set echo off
+234 sqlplus $user <<EOF1
+235 set heading off
+236 set feedback off
+237 spool $duplicatechecklog
+238 select $schema.func_checkif_duplicate_file2(TRIM('$filename'),TRIM('$filetype'),TRIM('$country')) s from dual;
+239 spool off
+240 EOF1
+241 fi
+242 dup=`sed 3q "$duplicatechecklog"|tail -1`
+243 #
+244 # set variable if any one file passes the count check
+245 if [ $reccount = $actualcount -a $dup = 0 ] ; then
+246 countcorrect=Passed

Error:
0403-057 Syntax error at line 228 : `then' is not matched.

Other Question i had was how does the Assignement Operator (=) and comparision Operator (==) differ in shell scripts, as i see they are used for the same purpose in some scripts only diff being the usage as in:

if [[ $country == "ABC"] then
blah ...blah
fi

if [ $country = "ABC"] then;
blah ...blah
fi

I am asking this because plese see the lines 227 & 245 they are written differently but still they are for the same purpose..checking condition.Any kind of suggestion would be appreciated.

thanks,
Ravi

You haven't close the limitstring EOF:

<<EOF
.
.
EOF

Regards

thanks for the reply Franklin52 but i did close it....see line numbers 234 and 240......the one you are mentioning is commented out.

thanks,
ravi

Hi,
I found the solution, here is what the problem was...i was missing ";" on the the lines 235 & 236

+234 sqlplus $user <<EOF1
+235 set heading off;
+236 set feedback off;
+237 spool $duplicatechecklog

------------

Other Question i had was, Is there anyway we can figure out where is the if condition ending....i have a script which has lot of "if statements" i need to know the ending block of certain IF condition..how will i know that in shell do we have any command..?? or got to just eye ball it..???

Search with Google for if then else ksh, and you'll get a bunch of tutorials handling this item.

Regards