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*

5
  • 1
    FYI that's not a recommended way to Pass shell variable as a /pattern/ to awk Commented Sep 8, 2019 at 13:03
  • sorry I was trying to show what I was starting with, I changed it now to where I'm stuck Commented Sep 8, 2019 at 14:10
  • Looks like you are missing a closing } in the broken example. Commented Sep 8, 2019 at 15:28
  • Your posted expected output with just the 1 IP address repeated in every block doesn't make sense wrt your posted sample input. Please fix it. Commented Sep 8, 2019 at 15:31
  • I fixed that. however, there can be entries with the same IP, but a different "path", as I have also changed. sorry about the confusion. Commented Sep 8, 2019 at 16:36