# Global replace command help

**URL:** <https://community.unix.com/t/global-replace-command-help/341047>\
**Category:** UNIX for Dummies Questions & Answers\
**Created:** [March 25, 2014, 8:27am UTC](https://community.unix.com/t/global-replace-command-help/341047 "2014-03-25T08:27:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DallasT](https://community.unix.com/letter_avatar/dallast/32/5_5575768a8748004e209b776fc1b2916d.png) [@DallasT](https://community.unix.com/u/DallasT)\
**Post date:** [March 25, 2014, 8:27am UTC](https://community.unix.com/t/global-replace-command-help/341047/1 "2014-03-25T08:27:02Z")

</div>

Hello -  
I am trying to use a global replace command but its not working.

Here is the cmd I am using in vi:

```plaintext
:%s/OLD/NEW/g

```

However, in my "NEW" I already have a "/" which is not making the replace work:

```plaintext
:%s/mytestscript.com:33232/mytestscript:70245/test.com/g

```

the "mytestscript:70245/test.com" is the parameter to replace "[mytestscript.com:33232](http://mytestscript.com:33232)"

Any idea how to fix this?

Thank you

---

<div class="post-metadata">

**Author:** ![SriniShoo](https://community.unix.com/letter_avatar/srinishoo/32/5_5575768a8748004e209b776fc1b2916d.png) [@SriniShoo](https://community.unix.com/u/SriniShoo)\
**Post date:** [March 25, 2014, 8:28am UTC](https://community.unix.com/t/global-replace-command-help/341047/2 "2014-03-25T08:28:27Z")

</div>

```nohighlight
%s/mytestscrip.com:33232/mytestscript:70245\/test.com/g

```

---

<div class="post-metadata">

**Author:** ![sea](https://community.unix.com/user_avatar/community.unix.com/sea/32/2946_2.png) [@sea](https://community.unix.com/u/sea)\
**Post date:** [March 25, 2014, 9:08am UTC](https://community.unix.com/t/global-replace-command-help/341047/3 "2014-03-25T09:08:52Z")

</div>

You could also use , or � (pipe) as the sed seperator.
