Checking the file if it exists

Hi

This will be useful who is looking for checking the files in a directory

#chmod 777 /cronacle/tools/teradata/opo/bin/file_check.sh
SUBJECT=`echo "File Not Found"`
SUBJECT1=`echo "File Found"`
#RECIPIENT=Madhu.Reddy@ge.com
cd /cronacle/tools/teradata/opo/bin
file_list=attach.sh
if [ -s $file_list ]
then
echo $file_list "$SUBJECT1" | mailx -s "$SUBJECT1" abc@abc.com
exit 1
else
echo $file_list "$SUBJECT" | mailx -s "$SUBJECT" abc@abc.com --mail id
exit 0
fi

Thanks
Babu

I thought -e was the switch to use to see if a file exists?

Quoting from man test

-e FileName
            Returns a True exit value if the specified FileName exists.

-s FileName
            Returns a True exit value if the specified FileName exists and has a size greater than 0.

krishmaths is right for the option -s and -e