I am trying to use sed to overwrite my index.php file, but I am getting an error:
$ sed -i \'s@@
Short answer :
$ chmod +w .
And re-run sed
.
Long answer :
As already said, the problem come from the fact that you don't have write permission on .
(the current directory from which you run sed
). If you are on your own machine/drive then you surely can give yourself the permission to write on this directory, that's what the chmod
do here, unless you want protect it for some reason. However, if your on a network drive and can't change your permission on it then you should ask the one that own the directory to do it or use a workaround solution like copy-modify-past the file somewhere else.