I want to recursively replace the "blah blah blah" in my License region with nothing:
#region License
blah blah blah
blah blah blah
#endregion
should be replaced with
#region License
#endregion
This should apply to all of of my .cs files in a certain directory (recursive). I tried this with sed, but since I am on windows, I had some problems with line endings. How can I do this with perl (or python), or something native to windows?
EDIT: here is the solution I came up with, thanks to everyone here!:
#/bin/bash
list=`find . -name '*.cs' -o -name '*.h' -o -name '*.cpp'`
for i in $list
do
perl -i~ -ne 'if (/#region License/../#endregion/) {print if /#(?:end)? region/;next};print' $i
done