![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Minicom runscript: How to send escape character ( \ ) | rkhanna | Shell Programming and Scripting | 1 | 10-02-2008 11:14 AM |
| read a variable character by character, substitute characters with something else | vipervenom25 | UNIX for Dummies Questions & Answers | 2 | 06-06-2008 04:18 PM |
| Escape character | deepakpv | Shell Programming and Scripting | 4 | 02-16-2007 03:19 AM |
| awk / escape character | OFFSIHR | Shell Programming and Scripting | 8 | 11-29-2006 01:28 PM |
| possible to escape the \ character in sed? | gammaman | UNIX for Dummies Questions & Answers | 1 | 07-07-2005 03:49 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I want to replace a string which contains "/" in vi but what is the escape character for forward slash?
e.g. I have a text file with the contents below and I want to replace "/Top/Sub/Sub1" with "ABC". /Top/Sub/Sub1 The replace command I am using is %s/string_before_replace/string_after_replace/g. |
|
||||
|
Make life easy for yourself. The "/" in the search/replace command is just a default. How about this:
%s#/Top/Sub/Sub1#ABC#g or %s+/Top/Sub/Sub1+ABC+g or %s_/Top/Sub/Sub1_ABC_g ...etc... You get the idea. If you know you've got a lot of /'s, try to avoid all those \/'s. It's ugly and error-prone. -mschwage |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|