So right now I have a variable
var1='batman'
I also have a file wrong.txt that reads as follows
SupermanJohn="Superman lives in Gotham City."
Superman'sJohn="Superman's parents were killed in Crime Alley."
SupermanJames="Superman hasdoes not have a bat-mobile."
Now I want to change the file's contents using sed. Obviously, I need to replace Superman with batman. I tried doing it with sed, but there were no changes made to the file.
Here is what I did
sed -i -e "s/SupermanJohn=\"Superman/$var1John=\"$var1/g" wrong.txt