UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 22nd, 2006, 03:01 PM
leelee7 leelee7 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 3 leelee7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 39 sec
Reputation Power: 0
Combine two pipe commands?

How can I combine both of the commands?

cat filename | uuencode filename | mail -s "test" me@me.com

cat body$ | mail -s "test" me@me.com

Basically I want an attachment AND a message in the body of an email, but I don't know how to pipe two things to mail. Thanks!

Reply With Quote
  #2  
Old June 22nd, 2006, 03:49 PM
leelee7 leelee7 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 3 leelee7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 39 sec
Reputation Power: 0
Answered my own question...

I found the answer over in Shell Programming and Scripting so I'll post it in case anyone else is curious.

/usr/bin/echo "Email text\nNew line\nAnother new line" >x | uuencode sourcefile.txt sourcefile.txt | cat x - | mailx -s "Email subject" -r "reply@to.com"

Credit given to haryadoon:
http://www.unix.com/showthread.php?t=18370

Reply With Quote
  #3  
Old June 23rd, 2006, 03:37 AM
madmatrix madmatrix is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 10 madmatrix User rank is Private First Class (20 - 50 Reputation Level)madmatrix User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 h 11 m 52 sec
Reputation Power: 0
to send message in the body and to attach a file,

here it is...
Code:
( echo "text in the body of the mail "; uuencode t t.txt ) | mailx -s "sub" "abc@xyz.com"

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Combine two pipe commands?


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT