Scripting Issue

I am having an issue with a script that I created today, my first attempt at this, and was wondering if anyone can give me insight to what changes need to be made. Below is a copy of the script that I have written. WEe are trying to monitor whether or not a services is running. I do have a cron running it every 10 minutes.

##
#Creation of the file for email body purposes
>$EmailBody
 
##
#Creation of reponse
ps -ef | grep dsmserv > $EmailBody
 
##
#Cleaning up of body file throught ED
ed $EmailBody < $EdFile
 
##
#If file does not contain data, email it...
if [ -s $EmailBody ]
then
(echo "\NThe Tivoli services are down...\n" ; cat $EmailBody) |mail -s "Services are down" 
"test@whoever.com"

fi
RetCode=$?
if [[ $RetCode == '0' ]]
then
FinAnormale $RetCode
fi
Exit 0

there is an email generate to my root account that shows an output message, but not I am not 100% sure where to go from here.

produced the following output:

/scripts/tivolirun.sh[20]: test: 0403-004 Specify a parameter with this command.
/scripts/tivolirun.sh[29]: FinAnormale:  not found.
/scripts/tivolirun.sh[32]: Exit:  not found.

Any insight or thoughts would be greatly appreciated!

No value in the variable $EmailBody. This is why the later test "if [ -s ]" is failing.
Needs to be preceded with a line like:
EmailBody="/tmp/my_filename.tmp"

The program or script "FinAnormale" does not exist. The whole statement is probably surplus.

Should be

exit 0

Could pick up the "grep".

ps -ef | grep "dsmserv" | grep -v "grep" > $EmailBody