3 # This is a script to replace one regular expression with another. Call
4 # it like `replace "foo bar" "bar foo"` to replace all "foo bar" text with
5 # "bar foo". By default it does replacement in *.[ch] files but this can
6 # be edited down below.
8 files
=`find . -name "*.[ch]"`
10 #files=`find . -type f -name "Makefile.am"`
11 #files=`find . -type f| grep -v CVS`
12 #files=`find . -name "*.ruleset"`
14 echo Replacing
\"$1\" with
\"$2\".
16 for file in $files; do
21 cmp $file $file.$$
>/dev
/null \
22 ||
(mv $file.$$
$file && echo " $file")