![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| parse through one text file and output many | sophiadun | UNIX for Dummies Questions & Answers | 14 | 02-20-2008 06:08 AM |
| parse text file | craggm | Shell Programming and Scripting | 9 | 02-27-2007 02:13 AM |
| parse text file | klick81 | Shell Programming and Scripting | 3 | 12-18-2006 12:04 PM |
| How to redirect all mails to text file? | redlotus72 | UNIX for Dummies Questions & Answers | 0 | 09-12-2006 12:27 AM |
| How to parse a text file with \034 as field and \035 as end of message delimiter? | indianya | Shell Programming and Scripting | 1 | 08-26-2005 09:20 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Parse Text file and send mails
Please help.
I have a text file which looks something like this aaa@abc.com, c:FilePath\Eaaa.txt bbb@abc.com, c:FilePath\Ebbb.txt ccc@abc.com, c:FilePath\Eccc.txt ddd@abc.com, c:FilePath\Eddd.txt...so on I want to write a shell script which will pick up the first field 'aaa@abc.com' and store it in some memory variable say Field1. Next I want to store c:FilePath\Eaaa.txt in Field2. Finally I want to send a mail to Field1 with Field2 as an attachment. I am new to Unix Shell scirpting and have no idea how to go about this !!!!! |
|
||||
|
Hi dhruva
I have the sample input feedfile in the same location from where I am running the script. There is no problem with that. the code is picking up the file name for the mail id. File Name : Eaaa.txt To : Eaaa.txt The field delimiter is a comma followed by a space. |
|
||||
|
Hi Dhruva
I tried ur newer suggestion : set -x for input_dir_row in `cat mailse1.lst` do file_name=`echo $input_dir_row | cut -f2` mail_id=`echo $input_dir_row | cut -d ',' -f1` SUBJ="Send mail from Unix with file attachments" TO=$mail_id ( cat << ! To : ${TO} Subject : ${SUBJ} ! cat << ! HOPE THIS WORKS you got mail from sendmail utility ! uuencode -m $file_name $file_name ) | sendmail -v ${TO} done Can u pls. explain what cat << ! To : ${TO} Subject : ${SUBJ} ! does exactly. From what I understand it assigns the To and Subject value and displays it on the screen. But since the time I have been using the '-m' option with uuencode i cannot see these values on the screen. What excatly is happening here ? Thanks |
![]() |
| Bookmarks |
| Tags |
| mailx, mailx attachment, sendmail |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|