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*

17
  • 1
    Are you looking for: grep -l "Updating" * | xargs sed 's/begin-\([0-9]*\).end/\1/', or grep -l "Updating" * | sed 's/begin-\([0-9]*\).end/\1/'? It looks like you want one of these, but provide example input and output to clarify. Commented Sep 23, 2019 at 16:11
  • 2
    Moving away from your abstract, can you explain using example input and output what it is that you want to do. Commented Sep 23, 2019 at 16:18
  • 5
    You seem to be focused on an XY Problem. Please state the actual goal instead of what you imagine to be the solution Commented Sep 23, 2019 at 16:22
  • 2
    I am still trying to understand your example. Commented Sep 23, 2019 at 16:27
  • 2
    Getting a list of filenames from grep -l is no better than parsing ls unless you're using GNU grep with the -Z option for NUL-separated output (note freebsd grep's -z doesn't work with -l). Use grep -l -Z ... Commented Sep 24, 2019 at 4:37