The UNIX and Linux Forums  


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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #10 (permalink)  
Old 06-04-2009
rubin's Avatar
rubin rubin is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2007
Posts: 321
Quote:
Originally Posted by Nejc View Post
...
The error returned is:

Code:
line 3: syntax error near unexpected token `('

I assume the problem is with the the character '. Am I right? Any ideas how I can fix this?

Thanks
It's not only the single quotes ' , but other special characters as well, such as \ " . , that need to be escaped too, and there are too many of them ..., better use a regex:


Code:
sed "s:<?php echo '<script language='JavaScript'>.*<\\\/script>'; ?>::" file > temp

I assumed that there are no other valid records with the same content in the corner tags, as the line above has.