Hello. I have a file that I need to modify. It looks like this:

[paragraph1]
key = value
key=value
..
..
..

[paragraph2]
key = value
key = value
..
..
..

I want to modify value to some specified setting for all appearances
of keyY in paragraphX, for all entries of paragraphX (you can have
repeated paragraphs).

I can do it in borne reading the file line by line, but I really need
a sed and/or awk solution.

thanks.