I have one requirement. Let’s say my file contents are
a
b
c
d
e
f
d
e
f
I want to print the lines from b
to 2nd time repeated d
. Is there any command using awk to do this?
Output should be
b
c
d
e
f
d
If it is first time b
, I know the command
awk '/b/,/d/' file.txt
But I want to print the text to the matching point if it repeats second time. I want to have the command with in one line.