Quote:
Originally Posted by Nejc
...
Nothing happens. index.temp gets created with the same content as index.php.
Below is a copy/paste of the command:
Code:
demo@soncek:~/demo2$ sed "s:<?php echo '<script language='JavaScript'>.*<\\\/script>'; ?>::" index.php > index.temp
|
I see ..., the previous code ( 3 backslashes ) worked fine in your previous sample, the code will work with the current sample if you remove only one
\ .
Anyway to have predictable results, you'd be better off of getting rid of the
<\/ pattern from the closing tag.
I get the desired output for
all samples with the following code ( note the differences ):
Code:
sed "s:<?php echo '<script language='JavaScript'>.*script>'; ?>::" filename
Tested OK in Solaris and Cygwin (
GNU sed).