nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

read txt file and send mail

This is a discussion on read txt file and send mail within the Shell scripting forums, part of the Development/Scripting category; Hi all, I need to create .sh script to convert files to mail... How to make it? I have two ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 25-04-2009, 03:49 AM
Junior Member
User
 
Join Date: Apr 2009
OS: AIX
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
veverka is on a distinguished road
Default read txt file and send mail

Hi all,

I need to create .sh script to convert files to mail... How to make it?

I have two files - file_a_20090330.txt and file_b_20090330.txt in one the same folder.

file_a_20090330.txt contains:

address123@email.com
Albert, Einstein, BC2005, AIX, Orlando
Peter, Novocky, BC2006, AIX, Orlando
Steffen, Dresser, address333@email.com, Lotus, Lotus Notes

address124@email.com
John, Millovic, 22451, AS, Fnet
Claude, Fitter, BC1983, AIX, Toronto

file_b_20090330.txt contains:

address233@email.com
Robert, Einstein, BC2005, AIX, Orlando
Anna, Novocky, BC2006, AIX, Orlando
Helga, Dresser, address333@email.com, Lotus, Lotus Notes

address244@email.com
Alfred, Millovic, 22451, AS, Fnet
Joan, Fitter, BC1983, AIX, Toronto



and I like to send emails:

first to address123@email.com which contains:

"Please confirm the information below:
Albert, Einstein, BC2005, AIX, Orlando
Peter, Novocky, BC2006, AIX, Orlando
Steffen, Dresser, address333@email.com, Lotus, Lotus Notes"


second to address124@email.com which contains:

"Please confirm the information below:
John, Millovic, 22451, AS, Fnet
Claude, Fitter, BC1983, AIX, Toronto"

and the next:

to address233@email.com which cointans:


"Please confirm the information below:
Robert, Einstein, BC2005, AIX, Orlando
Anna, Novocky, BC2006, AIX, Orlando
Helga, Dresser, address333@email.com, Lotus, Lotus Notes"

to address244@email.com which cointains:

"Please confirm the information below:
Alfred, Millovic, 22451, AS, Fnet
Joan, Fitter, BC1983, AIX, Toronto"


Thanks for help, I have tried, but it doesn't work
Reply With Quote
  #2 (permalink)  
Old 28-04-2009, 12:55 AM
Junior Member
User
 
Join Date: Apr 2009
OS: Ubuntu
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
fcojocaru is on a distinguished road
Default

Question(s):
1. Will the destination email always be single on a line?
2. Is "," the only field separator that we can encounter?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Postfix Users Send Mail Restriction caron_k2000 Mail Servers 2 25-08-2008 01:39 AM
Evolution unable to send mail satimis Mail Servers 0 20-01-2008 11:28 AM
send mail installation and configuration jhn_daz@yahoo.com Mail Servers 1 01-11-2007 09:37 AM
Read arguments from a file and pass them to binary file AHJ Shell scripting 1 31-10-2007 06:04 PM
send mail attachment solaris K.R. Solaris/OpenSolaris 1 01-02-2007 07:05 PM


All times are GMT +5.5. The time now is 07:10 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38