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 hid
correct version
replace() { if [ -n "$3" ]; then expr=-name\ $3; fi find $PWD -name '.*' -prune -o $expr -type f -exec sed -i s/$1/$2/g {} \; unset expr }