Prints lines between start_regex and stop_regex
xxxxxxxxxx
awk '/start_regex/,/stop_regex/ {print}' file.txt
Example Contents: File.txt
xxxxxxxxxx
Line 1
Line 2
Line 3
Line 4
Line 5
Example Execution using | (Pipe)
xxxxxxxxxx
cat File.txt | awk '/Line 2/,/Line 4/ {print}'
Example Direct Execution
xxxxxxxxxx
awk '/Line 2/,/Line 4/ {print}' File.txt
Example Output
xxxxxxxxxx
Line 2
Line 3
Line 4