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
  • 1
    The "more compatible" variant is still GNU only though as you would need to use {p;d;} in place of {p;d} and as \+ is not a BRE (you would use \{1,\} in a BRE instead of +). The command also fails to insert ; at the start of the first two lines. Commented Nov 29, 2021 at 10:27
  • The first command half worked, it wouldn't add quotes to the end of the lines and did not get separate the bracketed numbers. It did leave the first two header rows though which was good. The second command strangely gave me the exact same output as the first one. Commented Nov 29, 2021 at 13:59
  • @they The desired output does not have a ; in the first two lines. My BRE knowledge is from the grep man page and it does mention \+ but maybe that is GNU stuff without being mentioned. Commented Nov 29, 2021 at 14:53
  • Ah, I see that the output in the question changed some time ago, and I did not re-read it. My apologies. Yes, the GNU manuals sometimes fail to mention extensions. Commented Nov 29, 2021 at 14:55