The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
Parsing special characters between C and XML.. ronix007 UNIX for Dummies Questions & Answers 1 05-10-2008 07:39 AM
How to find special characters?? sumitc AIX 3 05-04-2008 09:20 PM
Quoting of special characters vibhor_agarwali UNIX for Dummies Questions & Answers 1 01-30-2005 04:58 AM
special characters nawnaw UNIX for Dummies Questions & Answers 2 05-18-2004 04:17 PM
awk/sed with special characters apalex Shell Programming and Scripting 5 05-06-2002 05:40 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-15-2007
tugger tugger is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 9
Put a \ in front of special characters in SED

I have a file with a text field that could contain characters the sed sees as special characters.

I need to be able to replace this text with other text, however if I use sed like:

sed 's/oldtext/newtext/g'

It errors stating garbled (something or other), which I am putting down to the fact it is reading the text literally and think the likes of / etc should be treated as special chars.

Is there a way around this so I can get it to ignore what it thinks are special chars? (just see the text - Wow *?/ woopee do /$)

By the way thats not the text I want to add
 

Bookmarks

Tags
perl, perl shift, regex, regular expressions, shift, shift perl

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:07 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0