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*

8
  • This breaks on empty lines... Commented Nov 18, 2015 at 7:23
  • it doesn't exactly break on empty lines, it just applies to them too. if you don't want to append \t whatever to empty lines, use sed -e 's/^.\+$/&\twhatever/' instead. or sed -e 's/^[A-Z0-9a-z]\+[[:space:]]\+[A-Z0-0a=z]\+$/&\twhatever/' Commented Nov 18, 2015 at 7:26
  • @cas I'll rephrase to accomodate your baseless nitpicking: "it produces unwanted output on emtpy lines, which in the real world is functionally equivalent to breakage." Commented Nov 18, 2015 at 7:29
  • it's not up to you to decide if it's "unwanted output". in some cases, that may be exactly what is wanted. saying that that is "broken" is, well, broken. Commented Nov 18, 2015 at 7:31
  • @jasonwryan: I didn't realize you had empty lines in your example, but I guess your transcript does. See my revised answer, which has two ways to do what you want. Commented Nov 18, 2015 at 7:33