Skip to content

Instantly share code, notes, and snippets.

@jordiclariana
Created July 31, 2015 10:17
Show Gist options
  • Save jordiclariana/90e211eb7a00b5289e39 to your computer and use it in GitHub Desktop.
Save jordiclariana/90e211eb7a00b5289e39 to your computer and use it in GitHub Desktop.
Print only a block of text
awk -v BINIT="START PATTERN" -v BEND="END PATTERN" '
{
if ($0 ~ BINIT) {
F=1
}
if ($0 ~ BEND) {
F=0
}
if (F==1) {
print $0}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment