The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
sendmail attachments rbatte1 UNIX for Dummies Questions & Answers 4 04-01-2009 06:50 AM
Sending Attachments Through mailx vrk1219 HP-UX 7 01-21-2009 03:18 PM
Aix Unix Mailx Attachments darioa AIX 3 01-07-2009 01:09 PM
Problem with multiple excel attachments using mailx ramanam2004 UNIX for Advanced & Expert Users 2 05-04-2006 02:07 AM
mailx error message : mailx: NUL changed to @ BG_JrAdmin UNIX for Dummies Questions & Answers 2 12-01-2005 10:27 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 Rating: Thread Rating: 1 votes, 4.00 average. Display Modes
  #1 (permalink)  
Old 08-01-2005
madmat madmat is offline
Registered User
  
 

Join Date: Aug 2005
Location: Paris
Posts: 80
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
  #2 (permalink)  
Old 08-01-2005
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,409
Try...
Code:
(  echo "message" 
   uuencode /path/to/file1 file1
   uuencode /path/to/file2 file2
   : etc
) | mailx -s "subject" abc@xyz.com
  #3 (permalink)  
Old 08-02-2005
madmat madmat is offline
Registered User
  
 

Join Date: Aug 2005
Location: Paris
Posts: 80
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
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 05:24 PM.


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