SED escape /

Hi experts,
I worked with the SED command and i want to replace a URL with the SED command in a configuration file.
In the configuration file i have this line:     /owa
And with the SED i want to replace this line so i used this command:

sed -e "s/owa https:.*/owa" /etc/apache2/sites-available/test.conf

and i got this error message: sed: -e expression #1, char 27: unknown option to `s'

without the / the command works so how can i escape or use the / in the command?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The usual way, with a backslash:
sed -e "s/owa https:.*/owa https:\/\/\/owa/g" /etc/apache2/sites-available/test.conf

Open in new window

Bu there's no need to escape, you can just use a different delimiter that isn't part of the search string:
sed -e "s#owa https:.*#owa" /etc/apache2/sites-available/test.conf

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Zephyr ICTCloud ArchitectCommented:
In SED you can replace / with any other character, like : @ !

Something like this:

sed -e "s:owa https:.*:owa" /etc/apache2/sites-available/test.conf

Open in new window

edit: too late :)
deibelAuthor Commented:
Thank you both.

I used your solutions and it works.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.