Shell script to compare text and send a mail

Hello,
Somebody can help me to develop a script for the below requirement

I have a 3 files in a directory which was dynamically changed everyday basis. I need a script to fetch the 1pattern of strings in each file. if the three matching pattern is same send a mail with subject as success else fail.

Thanks in advance.

Is this a homework assignment? Homework and coursework questions can only be posted in the Homework & Coursework forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

If you did not post homework, please explain the nature of the problem you are working on, the source of the files you need to process, the format of the files you need to process, the patterns that you expect to find in those files, a couple of sets of sample input files (one set that should satisfy your requirements and one set that should generate an e-mail message [also showing the contents of that e-mail]), other desired outputs from those sets of sample input files, the operating system you're using, the shell you're using, and show us what you have written to try to solve this on your own.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.