I used the following sed command to find and replace an old string with a new one:
cmd = "sed -i 's/"+oldstr+"/"+newstr+"/'"+ "path_to/filename" #change the string in the file
os.system(cmd) # am calling the sed command in my python script
But i get this error:
sed: -e expression #1, char 8: unterminated `s' command
Can someone tell me what is wrong with my sed command?
Or is anything wrong in the way I have given the file name?
Update:
echo of that command:
sed -i ‘s/6.9.28
/6.9.29/’ dirname/filename
Without calling
sedEDIT:
Incorporating Joran’s comment:
or even