3 # $0 oldString newString file1 .. fileN
7 echo "Usage: ${0##*/} <oldString> <newString> <file1> [.. fileN]"
9 echo "Replaces all occurrences of oldString by newString in files."
10 echo "(replacement for sed -i on systems that don't support it)"
20 if grep "$oldString" "$f" >/dev
/null
23 sed -e "s@$oldString@$newString@g" "${f}_bak" > "$f"
26 # echo "String $oldString not present in $f"
30 # ----------------------------------------------------------------- end-of-file