Skip to content

Instantly share code, notes, and snippets.

@maveonair
Created February 15, 2013 15:01
Show Gist options
  • Save maveonair/4960882 to your computer and use it in GitHub Desktop.
Save maveonair/4960882 to your computer and use it in GitHub Desktop.
Add a new text line after a specified pattern with awk
awk '{ if ( match($0, "^pattern") ) { printf "%s\n%s\n", $0, "new TEXT" } else { print } }' input_file.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment