I am using the Windows port of sed.exe
.
When I do something like that directly from the command line:
sed.exe -i "s/WRITE;/WRITE; TRUNCATE TABLE `Team_matchdayResults`;/g" my_script.sql
everything works flawlessly and the text parts are changed in the my_script.sql
file.
Now I want to do exactly the same but from within a .bat
file. What I know is that I have to escape double quotes there, so I did it like that.
sed.exe -i ""s/WRITE;/WRITE; TRUNCATE TABLE `Team_matchdayResults`;/g"" my_file.sql
Unfortunately this ends with the following error
sed.exe: -e expression #1, char 15: unterminated `s' command
I suppose that I have to escape something more but I seem to have no idea what exactly. I have read somewhere that ;
should be escaped in a batch file but only in FOR
loop. However this has not brought me any further.
What do I have to escape more?