![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Replace the last slash alone | christineida | Shell Programming and Scripting | 3 | 07-10-2008 12:07 AM |
| Help with SED and forward slash | gseyforth | Shell Programming and Scripting | 3 | 05-26-2008 07:29 AM |
| ftp username with back slash | sam99 | Shell Programming and Scripting | 1 | 04-29-2008 09:19 AM |
| awk slash | McLan | Shell Programming and Scripting | 6 | 04-09-2008 02:00 PM |
| grep for forward slash | wxornot | Shell Programming and Scripting | 3 | 02-29-2008 10:01 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
escaping / (forward slash)
how to escape / (forward slash) in a string.
I have following scnerio: sed s/${var1}{$var2} var1 and var2 both contain slashes, but sed gives error if there is a slash in var1 or var2. sed is used here to replace var1 with var2. Thanks in advance |
|
||||
|
Use something else than slash as the separator in sed.
Code:
sed "s%${var1}%${var2}%"
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|