Created
February 15, 2013 15:01
-
-
Save maveonair/4960882 to your computer and use it in GitHub Desktop.
Add a new text line after a specified pattern with awk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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