I am creating a shell script by using grep to track a loggrep log lines of a specific id requestScript to log...

A simple problem about Rule

Mutable named tuple with default value and conditional rounding support

Why is this weapon searching for a new owner?

Is the Dodge action perceptible to other characters?

What is this gigantic dish at Ben Gurion airport?

How major are these paintwork & rust problems?

Why some files are not movable in Windows 10

How to prepare for STEM graduate program while in industry?

Why is template constructor preferred to copy constructor?

How are unbalanced coaxial cables used for broadcasting TV signals without any problems?

Is a suit against a University Dorm for changing policies on a whim likely to succeed (USA)?

What is the mathematical notation for rounding a given number to the nearest integer?

Is "you will become a subject matter expert" code for "you'll be working on your own 100% of the time"?

How do certain apps show new notifications when internet access is restricted to them?

getting syntax error in simple bash script

What was redacted in the Yellowhammer report? (Point 15)

Why is my fire extinguisher emptied after one use?

What jurisdiction do Scottish courts have over the Westminster parliament?

Diffraction of a wave passing through double slits

What is and what isn't ullage in rocket science?

Is low emotional intelligence associated with right-wing and prejudiced attitudes?

Where to disclose a zero day vulnerability

How can I discourage sharing internal API keys within a company?

"Literally" Vs "In the true sense of the word"



I am creating a shell script by using grep to track a log


grep log lines of a specific id requestScript to log temperatureWill zgrep recursively search zips embedded within zips?Add time from all log files using bashgrep script - output lines at the same time into echoParameter expansionExecute independent greps in a single shell scriptHow to run string with values as a command in bash?Error in grep command to exit from a Unix Script






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















Instead of printing out this,



============ Normal grep location of the files ============
ems_inet1/SystemOut1.log
ems_rpt1/SystemOut_19.09.09_23.00.00.log
ems_rpt1/SystemOut_19.09.11_23.00.00.log
============ Compress grep location of the files ============
ems_rpt1/SystemOut_19.05.12_23.00.00.log.gz


I want to print out this instead,



============ Normal grep location of the files ============
ems_inet1 - SystemOut1.log
ems_rpt1 - SystemOut_19.09.09_23.00.00.log
ems_rpt1 - SystemOut_19.09.11_23.00.00.log
============ Compress grep location of the files ============
ems_rpt1 - SystemOut_19.05.12_23.00.00.log.gz


I does not want to have a slash and i want to separate it by a " - " dash



here is the my code



echo "============ Normal grep location of the files ============"
grep -Erl "${input}" ems*/SystemOut*.log
#
echo "============ Compress grep location of the files ============"
zgrep -Erl "${input}" ems*/SystemOut*.log.gz









share|improve this question







New contributor



Jun Hao is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




























    0















    Instead of printing out this,



    ============ Normal grep location of the files ============
    ems_inet1/SystemOut1.log
    ems_rpt1/SystemOut_19.09.09_23.00.00.log
    ems_rpt1/SystemOut_19.09.11_23.00.00.log
    ============ Compress grep location of the files ============
    ems_rpt1/SystemOut_19.05.12_23.00.00.log.gz


    I want to print out this instead,



    ============ Normal grep location of the files ============
    ems_inet1 - SystemOut1.log
    ems_rpt1 - SystemOut_19.09.09_23.00.00.log
    ems_rpt1 - SystemOut_19.09.11_23.00.00.log
    ============ Compress grep location of the files ============
    ems_rpt1 - SystemOut_19.05.12_23.00.00.log.gz


    I does not want to have a slash and i want to separate it by a " - " dash



    here is the my code



    echo "============ Normal grep location of the files ============"
    grep -Erl "${input}" ems*/SystemOut*.log
    #
    echo "============ Compress grep location of the files ============"
    zgrep -Erl "${input}" ems*/SystemOut*.log.gz









    share|improve this question







    New contributor



    Jun Hao is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.
























      0












      0








      0








      Instead of printing out this,



      ============ Normal grep location of the files ============
      ems_inet1/SystemOut1.log
      ems_rpt1/SystemOut_19.09.09_23.00.00.log
      ems_rpt1/SystemOut_19.09.11_23.00.00.log
      ============ Compress grep location of the files ============
      ems_rpt1/SystemOut_19.05.12_23.00.00.log.gz


      I want to print out this instead,



      ============ Normal grep location of the files ============
      ems_inet1 - SystemOut1.log
      ems_rpt1 - SystemOut_19.09.09_23.00.00.log
      ems_rpt1 - SystemOut_19.09.11_23.00.00.log
      ============ Compress grep location of the files ============
      ems_rpt1 - SystemOut_19.05.12_23.00.00.log.gz


      I does not want to have a slash and i want to separate it by a " - " dash



      here is the my code



      echo "============ Normal grep location of the files ============"
      grep -Erl "${input}" ems*/SystemOut*.log
      #
      echo "============ Compress grep location of the files ============"
      zgrep -Erl "${input}" ems*/SystemOut*.log.gz









      share|improve this question







      New contributor



      Jun Hao is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      Instead of printing out this,



      ============ Normal grep location of the files ============
      ems_inet1/SystemOut1.log
      ems_rpt1/SystemOut_19.09.09_23.00.00.log
      ems_rpt1/SystemOut_19.09.11_23.00.00.log
      ============ Compress grep location of the files ============
      ems_rpt1/SystemOut_19.05.12_23.00.00.log.gz


      I want to print out this instead,



      ============ Normal grep location of the files ============
      ems_inet1 - SystemOut1.log
      ems_rpt1 - SystemOut_19.09.09_23.00.00.log
      ems_rpt1 - SystemOut_19.09.11_23.00.00.log
      ============ Compress grep location of the files ============
      ems_rpt1 - SystemOut_19.05.12_23.00.00.log.gz


      I does not want to have a slash and i want to separate it by a " - " dash



      here is the my code



      echo "============ Normal grep location of the files ============"
      grep -Erl "${input}" ems*/SystemOut*.log
      #
      echo "============ Compress grep location of the files ============"
      zgrep -Erl "${input}" ems*/SystemOut*.log.gz






      bash shell grep






      share|improve this question







      New contributor



      Jun Hao is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question







      New contributor



      Jun Hao is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question






      New contributor



      Jun Hao is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 1 hour ago









      Jun HaoJun Hao

      1




      1




      New contributor



      Jun Hao is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      Jun Hao is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.



























          1 Answer
          1






          active

          oldest

          votes


















          0
















          grep -Erl "${input}" ems*/SystemOut*.log | sed 's#/# - #'





          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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });







            Jun Hao is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded
















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f541504%2fi-am-creating-a-shell-script-by-using-grep-to-track-a-log%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0
















            grep -Erl "${input}" ems*/SystemOut*.log | sed 's#/# - #'





            share|improve this answer






























              0
















              grep -Erl "${input}" ems*/SystemOut*.log | sed 's#/# - #'





              share|improve this answer




























                0














                0










                0









                grep -Erl "${input}" ems*/SystemOut*.log | sed 's#/# - #'





                share|improve this answer













                grep -Erl "${input}" ems*/SystemOut*.log | sed 's#/# - #'






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 14 mins ago









                WhiteWindWhiteWind

                2261 silver badge6 bronze badges




                2261 silver badge6 bronze badges


























                    Jun Hao is a new contributor. Be nice, and check out our Code of Conduct.










                    draft saved

                    draft discarded

















                    Jun Hao is a new contributor. Be nice, and check out our Code of Conduct.













                    Jun Hao is a new contributor. Be nice, and check out our Code of Conduct.












                    Jun Hao is a new contributor. Be nice, and check out our Code of Conduct.
















                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f541504%2fi-am-creating-a-shell-script-by-using-grep-to-track-a-log%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                    Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                    Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...