I'm trying to export a css rule from a css file with awk but I am not able to do it. I need only the rules containing the "background-image" line.
#rule{
...
background-image: url(path);
}
Here's what I have tried so far:
awk '/^[#].*{.*background-image.*/','/}/' css/file.css
What am I doing wrong?
At this moment I got the best result using:
/^[#A-Za-z.]/ { accum = 1; }
accum == 1 { css = css $0 "\n"; }
accum == 1 && /background-image/ { found = 1; }
/\}/ { accum = 0; if (found == 1) print css; found = 0; css = ""; }
and it allows me to get a full block with all the selectors