Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 1
    I'm afraid this is very confusing. Please edit your question and show us a representative example of your input files, making sure it covers all the cases you need, and the output you need from that example. Also, please add your operating system so we know what tools you have available. Commented Sep 25, 2023 at 13:03
  • @terdon. Edit done. Ought to be clear now Commented Sep 25, 2023 at 15:19
  • So you just want the output of the grep without the awk? What are you trying to do with that awk command? Are you just trying to add an empty line between groups of grep results from different files? I know you cannot show color, but can you show at least the text of the output you want? And you still haven't told us what operating system you are using. The grep on Linux is not the same as the one on macOS which is not the same as the one on other UNIX systems. Commented Sep 25, 2023 at 15:42
  • Don't use grep to find files, there's a perfectly good tool for finding files with a perfectly obvious name. Keep your code simple, portable, etc. by finding files with find and then g/re/ping within those files using grep (or use awk instead of grep if you want to do something other than just g/re/p - Globally match a Regular Expression and Print the result). Commented Sep 25, 2023 at 17:20
  • If you provide concise, testable sample input and expected output as text (not just images) then we can best help you. As of now, I could imagine several different things your question might be asking about. Commented Sep 25, 2023 at 17:30