Reading a file and sending mail by shell scripting?

hi I need help urgently...i need to write a shell script which can solve the following problem....its urgent plz help me out coz m totally newbie in shell scripting....
the problem is:
Suppose I have a folder called logs. whenever some error occurs some correspondence error file is generated.
I need a script that can first find out that there is a file with the string error in it. then can read it or can directly attach it with the mail(or in html text) and can send a mail to respected mail. can you please give me help that how i vl do it(considering new in shell script). as m confused with scripting but i have to do it.

Thanks

is the error string same at all times.

considering it the same everytime.....
Plz help me out

Hey Guys reply plz :frowning:

iam new to shell.. just tried this for u.

if [ (grep -c error_string file1 ) -ge 1 ] ; then
$ uuencode ur_logfile|mail urmail@mail.com
fi