Posted By

fugue on 05/09/07


Tagged

regex Bash sed


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

moonbather


Sed search & replace


 / Published in: Bash
 

Search all SVG files for a certain line, then replace them. Make a backup first, or at least add a tag for sed to make the backups for you.

  1. for file in *.svg; do
  2. sed -i 's/<rect x\=\"[0-9]*\" y\=\"[0-9]*\" width\=\"[0-9]*px\" height\=\"[0-9]*px\" fill\=\"\#FFFFFF\" \/>/<rect x\=\"0\" y\=\"0\" width\=\"100\%\" height\=\"100\%\" fill\=\"\#FFFFFF\" \/>/' $file;
  3. done

Report this snippet  

You need to login to post a comment.