Reading Delimited file and send mail with attachment

Hi All,

My requirement is:

  1. To read a file that contains log file location and server name. The format of the file is something like this :
    server_name1:logfilename1
    server_name2:logfilename2

  2. Now I wants to grep "error" string from the logfilename and put it into another file for each log.

  3. Finally , i would like to send a mail containing as attachement all the files that have captured error string from the logs.

Now, the problem is how could i attach all the files in a single mail and send it across.

Thanks,
AR

Check out 'mpack'?

Hi All,

I have used the following code to read the file :

Tha content of the LOGFILE.txt is :

Hello everyone,

Please suggest the solution of my problem posted above.