Email sending attachement with two file comparision

Hi guys,

I have two files . One file contains log record and another file contains emailids which is supposed to send it users

File1 :
Name : abc_xyz_data.txt
Which contains log record

File 2 :
Name : abc_xyz_mailids.txt
Which contains emailids.
abc@test.com
bcd@test.com

I would like to compare two file names
abc_xyz_data.txt=abc_xyz_mailids.txt

abc_xyz =abc_xyz are equal then file1 record should send it to
File 2( emailids list people) to log record.
Plese help to write a shell script

I am using kornshell to write shell script. Please help me

Regards,
orabalu

Hi Anyone,

Please help me . I would appreciate your help.

Regards,
orabalu

Hi Guys,

Please help me regarding my question.

Regards,
orabalu

It's not allowed to bump up questions, please read the rules.

Regards

This should work for you if I understood your question:

#!/bin/ksh
for DATAFILE in `ls data.txt`
do
FILE=`ls $DATAFILE | awk -F_ '{print $1"_"$2}'`
if [ -s $FILE
"mailids.txt" ]
then
for MAIL in `cat $FILE*"mailids.txt"`
do
mail -s "Put Subject Here" $MAIL < $DATAFILE
done
fi
done