I would like to split my CSS file into two separate files.I want to know how I may write a script to find specific word and then to delete till the first semicolon (included).For example:body { background:#fff; border:solid 1px red;}div { background:#fff; border:solid 1px red;}Expected result should be without the background rule,then continue on the same line and then go to the next line.
Filtering out CSS properties
linux;text processing
Maybe this is a job for regex:sed -e 's/\Wbackground:[^;]\+;//g'Change 'background:' for what you're asking.The \W maches non-word character. [^;] matches anything that isn't ;, one or more times. Followed by ;, which is all then replaced by nothing.