Skip to content

Commit 48ba969

Browse files
committed
patterns example
1 parent 42e7a7f commit 48ba969

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

files/pat.dat

-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,3 @@ END
1111
test 1
1212
test 2
1313
test 3
14-
OUTPUT
15-
test 4
16-
test 5

patterns.awk

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Records between two patterns
2+
# Example: awk -v begin="^OUTPUT" -v end="^END" -f patterns.awk files/pat.dat
3+
4+
$0 ~ end{flag=0}
5+
flag
6+
$0 ~ begin{flag=1}

0 commit comments

Comments
 (0)