shell scripting to send mail

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
-1
down vote

favorite












Created script and its writing in sample.txt, Unable to grep the below text "EX_R02"and need to send mail. kindly help.



cat sample.txt|mailx -a sample.txt -s "GG status Report" $MAIL_LIST


Sample.txt:



Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING
EXTRACT STOPPED EX_R02 00:00:03 01:10:37






share|improve this question


















  • 1




    As far as I can see, there is no text under EX_R02.
    – Kusalananda
    Apr 10 at 6:38














up vote
-1
down vote

favorite












Created script and its writing in sample.txt, Unable to grep the below text "EX_R02"and need to send mail. kindly help.



cat sample.txt|mailx -a sample.txt -s "GG status Report" $MAIL_LIST


Sample.txt:



Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING
EXTRACT STOPPED EX_R02 00:00:03 01:10:37






share|improve this question


















  • 1




    As far as I can see, there is no text under EX_R02.
    – Kusalananda
    Apr 10 at 6:38












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











Created script and its writing in sample.txt, Unable to grep the below text "EX_R02"and need to send mail. kindly help.



cat sample.txt|mailx -a sample.txt -s "GG status Report" $MAIL_LIST


Sample.txt:



Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING
EXTRACT STOPPED EX_R02 00:00:03 01:10:37






share|improve this question














Created script and its writing in sample.txt, Unable to grep the below text "EX_R02"and need to send mail. kindly help.



cat sample.txt|mailx -a sample.txt -s "GG status Report" $MAIL_LIST


Sample.txt:



Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING
EXTRACT STOPPED EX_R02 00:00:03 01:10:37








share|improve this question













share|improve this question




share|improve this question








edited Apr 10 at 6:38









Kusalananda

102k13200317




102k13200317










asked Apr 10 at 5:44









user3914150

33




33







  • 1




    As far as I can see, there is no text under EX_R02.
    – Kusalananda
    Apr 10 at 6:38












  • 1




    As far as I can see, there is no text under EX_R02.
    – Kusalananda
    Apr 10 at 6:38







1




1




As far as I can see, there is no text under EX_R02.
– Kusalananda
Apr 10 at 6:38




As far as I can see, there is no text under EX_R02.
– Kusalananda
Apr 10 at 6:38










1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










If you by "grep the below text EX_R02" mean "grep the text below for EX_R02", then you may simply replace your cat with grep "EX_R02":



grep "EX_R02" sample.txt | mailx -a sample.txt -s 'GG status Report' "$MAIL_LIST"





share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f436687%2fshell-scripting-to-send-mail%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    If you by "grep the below text EX_R02" mean "grep the text below for EX_R02", then you may simply replace your cat with grep "EX_R02":



    grep "EX_R02" sample.txt | mailx -a sample.txt -s 'GG status Report' "$MAIL_LIST"





    share|improve this answer
























      up vote
      0
      down vote



      accepted










      If you by "grep the below text EX_R02" mean "grep the text below for EX_R02", then you may simply replace your cat with grep "EX_R02":



      grep "EX_R02" sample.txt | mailx -a sample.txt -s 'GG status Report' "$MAIL_LIST"





      share|improve this answer






















        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        If you by "grep the below text EX_R02" mean "grep the text below for EX_R02", then you may simply replace your cat with grep "EX_R02":



        grep "EX_R02" sample.txt | mailx -a sample.txt -s 'GG status Report' "$MAIL_LIST"





        share|improve this answer












        If you by "grep the below text EX_R02" mean "grep the text below for EX_R02", then you may simply replace your cat with grep "EX_R02":



        grep "EX_R02" sample.txt | mailx -a sample.txt -s 'GG status Report' "$MAIL_LIST"






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 10 at 6:40









        Kusalananda

        102k13200317




        102k13200317






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f436687%2fshell-scripting-to-send-mail%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay