Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    9

    Unanswered: 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

  2. #2
    Join Date
    Jan 2004
    Location
    Bordeaux, France
    Posts
    320
    Try :

    cat $LOG_FILE1 $LOG_FILE2 | maix -s "Combined Mail" $MY_EMAIL
    Jean-Pierre.

  3. #3
    Join Date
    Sep 2003
    Posts
    9

    Thanks a lot..

    Thanks a lot for your help dude..

    -Chinna


    Originally posted by aigles
    Try :

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •