The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to attach a file in a email ting123 UNIX for Dummies Questions & Answers 3 04-11-2009 07:03 PM
How to attach a file & send mail thru script Mar1006 Shell Programming and Scripting 9 10-12-2006 09:54 AM
Need to attach a txt file while sending mail charan81 Shell Programming and Scripting 9 01-12-2006 01:44 AM
How to attach an excel file/ dat file thru unix mails diwakar82 Shell Programming and Scripting 1 01-06-2006 11:23 AM
How to attach a file in mail? firebirdonfire UNIX for Dummies Questions & Answers 1 03-29-2001 08:38 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-16-2007
madhumathikv madhumathikv is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 8
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
  #2 (permalink)  
Old 10-17-2007
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,938
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On




All times are GMT -4. The time now is 08:42 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0