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*

3
  • It worked reversing the line numbers with tac Commented Jun 28, 2020 at 13:02
  • That's a trick I learned 40 years ago when fixing compiler errors, which show line numbers. If you start editing at the bottom of the error list, the source line numbers match the error messages all the way up. But you get to check a lot of knock-on errors that way. Commented Jun 28, 2020 at 13:22
  • It is still a shed-load easier in the proper tool: awk '{ print; if (/run/) print ++n } One process, no shell loops, ten seconds to write. Commented Jun 28, 2020 at 13:29