Hands-on task
awk: lines between markers
In /root/log.txt there is a block between the marker lines --START-- and --END--. Write an awk program in the file /root/between.awk (handy to do in the Editor tab above the terminal): it prints the lines between the markers, not including the markers themselves. Run it with awk -f and write the result to /root/body.txt. The program will also be tested on another file — one with several blocks.
- awk
- state flag
- line ranges
- regular expressions
- next