it is much simpler than that.
for i in `find *` ; do sed -i -- 's/search string/target string/g' $i; done
find i
=> will iterate over all the files in the folder and in subfolders.
sed -i
=> will replace in the files the relevant string if exists.