I'm missing something about awk pattern matching a using flags --
Given a file:
2019 foo
a
b
c
2019 bar
d
e
f
2019 foobar
g
h
i
I can use awk with flags and get the expected output --
awk '/foo/{flag=1;next} /^[0-9]+/{flag=0} flag' file
a
b
c
g
h
i
But if I exclude the next to include the matched pattern, then nothing is printed. Does awk continue from the matched line?
Using another syntax --
awk '/foo/,/2019/' file
2019 foo
2019 foobar
I was expecting awk to print between and including the match. I'm definitely missing something on syntax.