#!/bin/sh

#replace uniqueString newString
#
#replaces uniqueString by newString 
#in files *.[ch]*x *.pro *.str Makefile of this directory

for filename in *.[ch]*x *.pro *.str Makefile
do
  if test -f $filename ; then
    sed -e "s/$1/$2/g" < $filename > $filename.TMP
    if  cmp -s $filename $filename.TMP ; then
      rm $filename.TMP
    else
      echo "Modified $filename, the old version is in $filename.OLD"
      mv $filename $filename.OLD
      mv $filename.TMP $filename
    fi
  fi
done
