Awk: from two file create a mail with attached error

Hi. My name is Mirko
I have two file.

File 1:

mio@mio.it
tst@test.com
bye@bye.fr

File 2:

error 08 ffff mio@mio.it test
error 05 ffff bye@bye.fr test
error 11 ffff tst@test.com test
error 65 ffff mio@mio.it test
error 55 ffff bye@bye.fr test

Examples
I would like to send a mail to "mio@mio.it" with attached enclosed its error file:

error 08 ffff mio@mio.it test
error 65 ffff mio@mio.it test

Same for each email address of the first file.

Sorry if they are not clear enough
many thanks

Using shell script:-

sort -u File_1 | while read email_addr
do
   grep $email_addr File_2 > Error.txt
   ( uuencode Error.txt Error.txt; ) | mailx -m -s "Error" $email_addr
done 
1 Like

the script works........ problem solved !!!

many thanks