How do I find and replace every occurrence of:
subdomainA.example.com
with
subdomainB.example.com
in eve
grep -lr 'subdomainA.example.com' | while read file; do sed -i "s/subdomainA.example.com/subdomainB.example.com/g" "$file"; done
I guess most people don't know that they can pipe something into a "while read file" and it avoids those nasty -print0 args, while presevering spaces in filenames.
Further adding an echo
before the sed allows you to see what files will change before actually doing it.