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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sending Attachments Through mailx vrk1219 HP-UX 4 08-27-2007 08:06 AM
sendmail attachments rbatte1 UNIX for Dummies Questions & Answers 3 06-22-2007 06:14 AM
Problem with multiple excel attachments using mailx ramanam2004 UNIX for Advanced & Expert Users 2 05-03-2006 10:07 PM
mailx error message : mailx: NUL changed to @ BG_JrAdmin UNIX for Dummies Questions & Answers 2 12-01-2005 07:27 AM
Aix Unix Mailx Attachments darioa AIX 2 10-10-2005 04:53 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-01-2005
Registered User
 

Join Date: Aug 2005
Location: Paris
Posts: 75
ksh : using mailx and attachments

Hi

I want to use mailx command to send a message included more than one file.
I tried to use uuencode in pipe but it could only generate one file.
I would avoid using an archive file

Thanks to read you.

Mathieu
Reply With Quote
Forum Sponsor
  #2  
Old 08-01-2005
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,249
Try...
Code:
(  echo "message" 
   uuencode /path/to/file1 file1
   uuencode /path/to/file2 file2
   : etc
) | mailx -s "subject" abc@xyz.com
Reply With Quote
  #3  
Old 08-01-2005
Registered User
 

Join Date: Aug 2005
Location: Paris
Posts: 75
Thanks a lot Igor

I toke your idea to write my solution
You could find it bellow :

SUBJECT=$1
BODY=$2
RECIPIENT=$3
FILE=$4 #Files to attach (like /tmp/myfiles_*.txt)

(cat $BODY
for i in `ls -1 $FILE`
do
file_name=`basename $i`
uuencode $i $file_name
done
) | mailx -s "$SUBJECT" $RECIPIENT

Regards
Mathieu
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:09 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0