I have a change I need to make across multiple different sites and may need to make again in the future, so I'd like to put it in a shell script. Essentially I want to find a specific class block in a css file, find one of its attributes and change the value of that attribute.
So for example:
.some-id {
some-arbitrary-properties
property-i-want: old-value
maybe-some-more-properties
}
I want to only change old-value in property-i-want, and only if it's in .some-id.
I'm very comfortable with grep, but it only works one line at a time. I'm somewhat less comfortable with sed, but I haven't seen any way to do this without a deterministic set of properties. For instance, I could have sed replace the entire block. But I want to leave any other properties in the block alone.
I'd rather not use perl or python, but I can. I'd like to keep it short, because it's going in a script of one-liners.