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*

4
  • Don't you need the double quotes somewhere here? Commented Dec 23, 2024 at 22:33
  • @ArkadiuszDrabczyk you are right. I've updated my answer. Commented Dec 23, 2024 at 22:41
  • Thanks, can you explain what the "1q;d" syntax is doing exactly? Commented Dec 23, 2024 at 22:44
  • 1
    The big disadvantage of this method is that you need to run sed for all lines, either manually or in a loop and what's worse manually control all variable names. Commented Dec 23, 2024 at 23:10