If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > ksh - Sending email - use 2 files

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-04-04, 14:16
chinna16 chinna16 is offline
Registered User
 
Join Date: Sep 2003
Posts: 9
ksh - Sending email - use 2 files

Hi all,

I have a question in ksh which someone here I thought might answer quickly.

I have the following command to send email in my shell script.
----------------
LOG_FILE=log.txt
mailx -s "Test Message" $MY_EMAIL <$LOG_FILE
----------------
As it seems, This sends an email to MY_EMAIL attaching the text from log.txt

Now, My situation has beocme complex and I need to send text from two files in single email.. How do I do this?
----------------
LOG_FILE1=log1.txt
LOG_FILE2=log2.txt
maix -s "Combined Mail" $MY_EMAIL <$LOG_FILE1 <$LOG_FILE2
----------------
This gives an error as its bad input redirect..

How do I achieve this? Any help is greatly appreciated..

Thanks in advance,
-Chinna
Reply With Quote
  #2 (permalink)  
Old 02-04-04, 16:41
aigles aigles is offline
Registered User
 
Join Date: Jan 2004
Location: Bordeaux, France
Posts: 319
Try :

cat $LOG_FILE1 $LOG_FILE2 | maix -s "Combined Mail" $MY_EMAIL
__________________
Jean-Pierre.
Reply With Quote
  #3 (permalink)  
Old 02-04-04, 16:56
chinna16 chinna16 is offline
Registered User
 
Join Date: Sep 2003
Posts: 9
Thanks a lot..

Thanks a lot for your help dude..

-Chinna


Quote:
Originally posted by aigles
Try :

cat $LOG_FILE1 $LOG_FILE2 | maix -s "Combined Mail" $MY_EMAIL
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On