I need to use the output of a command as a search pattern in sed. I will make an example using echo, but assume that can be a more complicated command:
echo
this works on Linux(tested):
find . -type f -print0 | xargs -0 sed -i 's/str1/str2/g'