[sed || gawk]: find and delete blocks and lines from file
I have a file named foo.bar
It consists of something like this:
I need to locate and remove either anything from [foo1] to [foo2], OR barbar= ONLY in block [foo2]. How do i do this by sed or awk?