
01-03-2009
|
|
Shell programmer, author
|
|
|
Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,361
|
|
Quote:
Originally Posted by figaro
When installing apache22, in the file httpd.conf the following line
Code:
#ServerName www.example.com:80
needs to be replaced commonly by
Code:
ServerName localhost:80
I tried using the following
Code:
sed -i 's/#ServerName www.example.com:80/ServerName localhost:80/' \
/usr/local/etc/apache22/httpd.conf
but the error message was:
Code:
sed: 1: "/usr/local/etc/apache22 ...": extra characters at the end of l command
and the substitution was not made. What is the correct sed command to achieve the substitution?
|
First, don't use the -i option to sed without giving a backup extension, especially when you are having problems with it.
Second, there is nothing wrong with your sed command (unless you are using a sed which doesn't support -i or a *BSD sed which requires a backup extension with -i).
|