Reputation: 6024
I have the following sed command to comment out phpinfo() from my index.php:
sudo sed -i "s/phpinfo();/\/\/phpinfo();/g" index.php
But it gives me:
$ sudo sed -i "s/phpinfo();/\/\/phpinfo();/g" index.php
sed: 1: "index.php": command i expects \ followed by text
If I try to specify the entire path, it does the same thing:
sed: 1: "/Library/WebServer/Docu ...": invalid command code W
What am I doing wrong?
Upvotes: 2
Views: 291
Reputation: 785256
Try this sed:
sudo sed -i.bak "s~phpinfo();~//phpinfo();~g" index.php
-i
flag/
Upvotes: 2