![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to attach a file & send mail thru script | Mar1006 | Shell Programming and Scripting | 9 | 10-12-2006 05:54 AM |
| How to attach a file in a email | ting123 | UNIX for Dummies Questions & Answers | 2 | 05-11-2006 03:14 PM |
| Need to attach a txt file while sending mail | charan81 | Shell Programming and Scripting | 9 | 01-11-2006 09:44 PM |
| How to attach an excel file/ dat file thru unix mails | diwakar82 | Shell Programming and Scripting | 1 | 01-06-2006 07:23 AM |
| How to attach a file in mail? | firebirdonfire | UNIX for Dummies Questions & Answers | 1 | 03-29-2001 04:38 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
hi.. how to attach a tar file using shell script
Hi,
How to attach a tar file using shell script or the command liine.. I following command just send the mail to the person with .txt file as body, I want to send it as attachment. /usr/sbin/sendmail -f "user1@daemon.com" user2@daemon.com <hi.txt The contents of the hi.txt will be sent as the body of the message.. Please help..... Thanks in advance.. Madhu |
| Forum Sponsor | ||
|
|
|
|||
|
There is no simple oneliner for doing this. The classic UNIX way would be to uuencode the tarball and embed it as part of your message. There are however a number of ways of building a message with an attachment.
The following should work if your version of uuencode supports the -m option (but I have no tested it!) (cat hi.txt ; uuencode -m file.tar tarball) | sendmail -f "user1@daemon.com" Here are a couple of pointers: Mailing Attachments from UNIX Sending email with a text message and an attachment from standard UNIX. |
|||
| Google UNIX.COM |