'Replace a string with another recursively in all subdirectories

I am trying to run below sh file but getting error.

Var1="//abcdef"

Var2="//mnbvcx"

find ./ \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s/{$Var1}/{$Var2}/g"

Error message -

sed: -e expression #1, char 7: unknown option to `s'

Also while executing I want to the contents of the sh file not to change.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source