I want to ignore all hidden files, but especially .git and .svn ones when searching (and later replacing) files, not I have found that the most basic way to exclude such hidden files described in many online tutorials doesn't work here.
find . -not -name ".*"
will also print hidden files.
The script I'm trying to write is
replace() {
if [ -n "$3" ]; then expr="-name \"$3\""; fi
find . -type f \( $expr -not -name ".*" \) -exec echo sed -i \'s/$1/$2/g\' {} \;
unset expr
}