Skip to content

Instantly share code, notes, and snippets.

@fixlr
Created December 8, 2009 16:29
Show Gist options
  • Save fixlr/251770 to your computer and use it in GitHub Desktop.
Save fixlr/251770 to your computer and use it in GitHub Desktop.
One-liner to add a new line of text after the regex matches
awk '{print};/foo/{print "bar"}' example.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment