This is related to another question that I recently asked.
I have a text file which has multiple sections. Part of the file looks like this.
3. line 3
4. line 4
## Screenshots ##
1. line 1
2. line 2
3. line 3
4. line 4
## Changelog ##
3. line 3
4. line 4
I want to transform this file, such that all the lines of the file are present in the transformed file and the lines in the screenshot
section are passed through another command, before being added to this file.
So the transformed file might look like
3. line 3
4. line 4
## Screenshots ##
1. modified 1
2. modified 2
3. modified 3
4. modified 4
## Changelog ##
3. line 3
4. line 4
I have the following command which prints only the lines in the screenshot
section. (From here)
awk '/^## Screenshot/{p=1;print;next} p&&/^##/{p=0};p' readme.md
I tested my command by piping to the output of the above command and it works.
But now I want to print the other lines of the file untouched as well. How to do that?