I'm trying to do a find and replace using sed in a terminal.
Within the apache config file, I'm trying to replace:
DocumentRoot /var/www
with
DocumentRoot /var/www/mysite.com/public_html
From the command line, without using an editor. I'd like to do this with sed, and I've tried various iterations of:
sudo sed -i 's/'DocumentRoot /var/www'/'DocumentRoot /var/www/mysite.com/public_html'/' /etc/apache2/sites-available/mysite.com
However when doing so I get this error:
sed: -e expression #1, char 14: unterminated s command
So it's erroring on the slashes in the paths. How do I get around this?
Thanks for your help