Sending two text files with mail command - No -a support [duplicate]












0
















This question already has an answer here:




  • Trying to send multiple text attachments via mail message

    1 answer




I searched but did not find this answer. I am running an old RedHat 5.3 system on one server (working on upgrade to 7 in progress) but I want to send 2 text files using the mail command. I do this all the time with a single file like this:



mail username -s 'MySubject' < /home/directory/file1.txt


I tried this:



mail username -s 'MySubject' < /home/directory/file1.txt < /home/directory/file2.txt


But that send the output of the first part including the results of the mail command along with both text files.



Is there a better way to do this?










share|improve this question















marked as duplicate by Jeff Schaller, Thomas, msp9011, Archemar, Kusalananda linux
Users with the  linux badge can single-handedly close linux questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 21 at 13:30


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.























    0
















    This question already has an answer here:




    • Trying to send multiple text attachments via mail message

      1 answer




    I searched but did not find this answer. I am running an old RedHat 5.3 system on one server (working on upgrade to 7 in progress) but I want to send 2 text files using the mail command. I do this all the time with a single file like this:



    mail username -s 'MySubject' < /home/directory/file1.txt


    I tried this:



    mail username -s 'MySubject' < /home/directory/file1.txt < /home/directory/file2.txt


    But that send the output of the first part including the results of the mail command along with both text files.



    Is there a better way to do this?










    share|improve this question















    marked as duplicate by Jeff Schaller, Thomas, msp9011, Archemar, Kusalananda linux
    Users with the  linux badge can single-handedly close linux questions as duplicates and reopen them as needed.

    StackExchange.ready(function() {
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function() {
    $hover.showInfoMessage('', {
    messageElement: $msg.clone().show(),
    transient: false,
    position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
    dismissable: false,
    relativeToBody: true
    });
    },
    function() {
    StackExchange.helpers.removeMessages();
    }
    );
    });
    });
    Jan 21 at 13:30


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





















      0












      0








      0









      This question already has an answer here:




      • Trying to send multiple text attachments via mail message

        1 answer




      I searched but did not find this answer. I am running an old RedHat 5.3 system on one server (working on upgrade to 7 in progress) but I want to send 2 text files using the mail command. I do this all the time with a single file like this:



      mail username -s 'MySubject' < /home/directory/file1.txt


      I tried this:



      mail username -s 'MySubject' < /home/directory/file1.txt < /home/directory/file2.txt


      But that send the output of the first part including the results of the mail command along with both text files.



      Is there a better way to do this?










      share|improve this question

















      This question already has an answer here:




      • Trying to send multiple text attachments via mail message

        1 answer




      I searched but did not find this answer. I am running an old RedHat 5.3 system on one server (working on upgrade to 7 in progress) but I want to send 2 text files using the mail command. I do this all the time with a single file like this:



      mail username -s 'MySubject' < /home/directory/file1.txt


      I tried this:



      mail username -s 'MySubject' < /home/directory/file1.txt < /home/directory/file2.txt


      But that send the output of the first part including the results of the mail command along with both text files.



      Is there a better way to do this?





      This question already has an answer here:




      • Trying to send multiple text attachments via mail message

        1 answer








      linux mail-command






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 20 at 2:27









      user1794469

      1,5841822




      1,5841822










      asked Jan 20 at 2:13









      Scott PatersonScott Paterson

      31




      31




      marked as duplicate by Jeff Schaller, Thomas, msp9011, Archemar, Kusalananda linux
      Users with the  linux badge can single-handedly close linux questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Jan 21 at 13:30


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by Jeff Schaller, Thomas, msp9011, Archemar, Kusalananda linux
      Users with the  linux badge can single-handedly close linux questions as duplicates and reopen them as needed.

      StackExchange.ready(function() {
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function() {
      $hover.showInfoMessage('', {
      messageElement: $msg.clone().show(),
      transient: false,
      position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
      dismissable: false,
      relativeToBody: true
      });
      },
      function() {
      StackExchange.helpers.removeMessages();
      }
      );
      });
      });
      Jan 21 at 13:30


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          You'll need to concatenate the two files into a single unit before piping them to the mail command. Like this, for example:



          cat /home/directory/file1.txt /home/directory/file2.txt | mail username -s 'MySubject'





          share|improve this answer






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You'll need to concatenate the two files into a single unit before piping them to the mail command. Like this, for example:



            cat /home/directory/file1.txt /home/directory/file2.txt | mail username -s 'MySubject'





            share|improve this answer




























              0














              You'll need to concatenate the two files into a single unit before piping them to the mail command. Like this, for example:



              cat /home/directory/file1.txt /home/directory/file2.txt | mail username -s 'MySubject'





              share|improve this answer


























                0












                0








                0







                You'll need to concatenate the two files into a single unit before piping them to the mail command. Like this, for example:



                cat /home/directory/file1.txt /home/directory/file2.txt | mail username -s 'MySubject'





                share|improve this answer













                You'll need to concatenate the two files into a single unit before piping them to the mail command. Like this, for example:



                cat /home/directory/file1.txt /home/directory/file2.txt | mail username -s 'MySubject'






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 21 at 9:20









                telcoMtelcoM

                16.5k12345




                16.5k12345















                    Popular posts from this blog

                    How to make a Squid Proxy server?

                    Is this a new Fibonacci Identity?

                    19世紀