How to write a bourne shell to do with logfiles??

Hi,I have a task have to do is writing an only Bourne shell to do with logfiles.
Because I am not really a programmer,just unix administrator.
So I need someone can do this for me.

The requirement is
1,be able to run in an environment that does not include a path. (i.e. the environment provided by cron)

2,accept the name of a logfile as the sole command line argument

3,search the specified logfile for lines that have been added since the previous search.

4,construct an e-mail reporting any lines that contain either "error" or "warning" in any combination of upper and lower case letters

5,send the e-mail to the address specified in the RECIPIENT shell variable which is defined within the script

We want to help you if you have shown that you have put some effort into solving your problem but not to do your work for you, we are not a helpdesk service.

On the other hand, this really smells like homework to me.

Easy enough. Just have the script fix its own path.

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin"

What if the logfile's been truncated since last time it ran?

Cron output should be automatically mailed without doing anything special if cron is configured correctly.