harbour-books/tools/replace.sh
Slava Monich cd357843cb Squashed 'fbreader/fbreader/' content from commit 7abc80d
git-subtree-dir: fbreader/fbreader
git-subtree-split: 7abc80d12fab06b05ea1fe68a0e73ea5e9486463
2015-05-26 23:59:24 +03:00

14 lines
279 B
Bash
Executable file

#!/bin/sh
if [ $# -ne 2 ]; then
echo -e "usage:\n\t$0 <from_pattern> <to_pattern>";
exit 0;
fi
echo will replace $1 by $2
for file in `find . -type f -a -name "*.h" -o -name "*.cpp" -o -name "*.M"`; do
if grep -q "$1" $file; then
sed -e s/$1/$2/ -i \"\" $file;
fi;
done